Crypt::...keyPatch(3)
π Crypt::URandom::MonkeyPatch π
okay bestie, so this is the Crypt::...keyPatch(3) page β yeah the name's a little chopped in the header, that's just how the manual file rolls, the full module is Crypt::URandom::MonkeyPatch and it lives in the User Contributed Perl Documentation section. sit down, grab a boba, we're talking about β¨randomnessβ¨.
β¨ NAME β¨
Crypt::URandom::MonkeyPatch β override the core rand function to use system random sources π
πΈ VERSION πΈ
version v0.1.4
π¦ SYNOPSIS π¦
use Crypt::URandom::MonkeyPatch;
that's it. that's the whole vibe. one line and you've rewritten reality π
π DESCRIPTION π
So like, this module globally overrides the builtin Perl function rand with one that's based on your operating system's cryptographic random number source β think /dev/urandom, the good stuff. π₯
The whole purpose of this module is to monkey patch legacy code that uses rand for security purposes. Like, code from 2009 that's still out there generating salts with rand?? bestie. we gotta fix that. π
You can verify it's working by running your code with the CRYPT_URANDOM_MONKEYPATCH_DEBUG environment variable set, e.g.:
local $ENV{CRYPT_URANDOM_MONKEYPATCH_DEBUG} = 1;
my $salt = random_string("........");
Every single time the rand function gets called, it will output a line such as:
Crypt::URandom::MonkeyPatch::urandom used from Some::Package line 123
not it telling on your code like that π but also... iconic for debugging.
β¨ EXPORTS β¨
π rand
This globally overrides the builtin rand function using 31-bits of data from the operating system's random source. thirty-one bits of pure OS-grade chaos, no cap. π
π KNOWN ISSUES π
Okay listen, this module is NOT intended for use with new code, or for use in CPAN modules. fr fr. If you are writing new code that needs a secure source of random bytes, then use Crypt::URandom or see the CPAN Author's Guide to Random Data for Security (https://security.metacpan.org/docs/guides/random-data-for-security.html).
bestie this is a rescue mission, not a lifestyle. This should only be used when the affected code cannot be updated. π
And because this updates the builtin function globally, it may affect other parts of your code. like, the whole entire program. every rand everywhere. it's giving main character energy and honestly it is the main character now. π«Ά
π SEE ALSO π
Crypt::URandomCOREperlfunc
π SOURCE π
The development version is on github at https://github.com/robrwo/perl-Crypt-URandom-MonkeyPatch and may be cloned from https://github.com/robrwo/perl-Crypt-URandom-MonkeyPatch.git
clone it bestie, it's right there π§
π SUPPORT π
Only the latest version of this module will be supported. (yes, only the newest one. upgrade or perish, sorry.)
Only Perl versions released in the past ten (10) years are supported, even though this module may run on earlier versions. so if your Perl is older than ten years... she may still run but you're on your own, gorgeous. π
Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/perl-Crypt-URandom-MonkeyPatch/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. receipts, bestie, we need receipts π§Ύβ¨
π Reporting Security Vulnerabilities
Security issues should not be reported on the bugtracker website. Please see SECURITY.md for instructions how to report security vulnerabilities. do not put a security vuln in the public issue tracker, i am begging π
π AUTHOR π
Robert Rothenberg <perl@rhizomnic.com>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2025-2026 by Robert Rothenberg <perl@rhizomnic.com>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
and that's the whole page, bestie!! π this was Crypt::...keyPatch(3), running on perl v5.42.3, dated 2026-09-27 β mwah, slay, go patch responsibly ππ¦β¨
π¦ where this page comes from
- fedora 43: perl-Crypt-URandom-MonkeyPatch 0.1.4-1.fc43 Β· Artistic-2.0
- fedora 44: perl-Crypt-URandom-MonkeyPatch 0.1.4-1.fc44 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms