Crypt:...:Source(3pm)

πŸ’– Crypt::Random::Source β€” the manual, but make it cute πŸ’–

okay bestie, so this is a User Contributed Perl Documentation page for Crypt::Random::Source(3pm) and honestly? it's giving "tiny module, big opinions." let's get into it 🫢


✨ NAME ✨

Crypt::Random::Source β€” get weak or strong random data from pluggable sources πŸ’…

🌸 VERSION 🌸

version 0.14

⭐ SYNOPSIS ⭐

use Crypt::Random::Source qw(get_strong);

# get 10 cryptographically strong random bytes from an available source
my $bytes = get_strong(10);

like. that's it. ten bytes. cryptographically strong. we love a low-effort high-security moment πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

This module provides implementations for a number of byte oriented sources of random data. ✨

See Crypt::Random::Source::Factory for a more powerful way to locate sources, and the various sources for specific implementations. iykyk πŸ’œ

πŸ’… EXPORTS πŸ’…

  • get
  • get_weak
  • get_strong

These functions delegate to a source chosen by an instance of Crypt::Random::Source::Factory, calling get. no cap, that's literally the whole thing β€” the factory picks the source, the function calls get on it. slay.

😭 CAVEATS 😭

⚠️ okay this part is lowkey important so pay attention bestie ⚠️

In versions prior to 0.13, "rand" could be used as a result of calling "get_weak", or "get", if no random device was available. This implies that not explicitly asking for "get_strong" on a non POSIX operating system (e.g. Win32 without the Win32 backend) could have resulted in non cryptographically random data. πŸ’€ like. that's the whole point of the module. gone. reduced to atoms.

Relatedly, the characterization of "urandom" as a weak source of randomness is also largely a misconception, see <https://www.2uo.de/myths-about-urandom/> for example. 🧚 (yes it's a URL, no I can't make it a link, terminal rules are terminal rules, go read it though, it eats.)

πŸ‘‘ SEE ALSO πŸ‘‘

  • Crypt::Random
  • Crypt::Util

πŸ› SUPPORT πŸ›

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-Random-Source> (or bug-Crypt-Random-Source@rt.cpan.org <mailto:bug-Crypt-Random-Source@rt.cpan.org>).

like, if something's broken, tell the tracker, don't just suffer in silence. the vibes will be better for everyone 🫢

✨ AUTHOR ✨

XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org>

🌈 CONTRIBUTORS 🌈

  • Karen Etheridge <ether@cpan.org>
  • Florian Ragwitz <rafl@debian.org>
  • Graham Knop <haarg@haarg.org>
  • David Pottage <spudsoup@cpan.org>
  • Max Kanat-Alexander <mkanat@es-compy.(none)>
  • Edward Betts <edward@4angle.com>

the whole squad showed up and honestly? iconic. πŸ‘‘

This software is copyright (c) 2008 by Yuval Kogman.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the tea β˜• β€” this page came from perl v5.34.0 and it was dated 2022-04-09, so if you're reading it in the far-flung future, hi, hope the random bytes are still random πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from