P5-bytes-random-secure

Jul 20, 2023

Generate cryptographically-secure random bytes

BytesRandomSecure provides two interfaces for obtaining crypto-quality random bytes. The simple interface is built around plain functions. For greater control over the Random Number Generator’s seeding, there is an Object Oriented interface that provides much more flexibility.

The “functions” interface provides functions that can be used any time you need a string of a specific number of random bytes. The random bytes are available as simple strings, or as hex-digits, Quoted Printable, or MIME Base64. There are equivalent methods available from the OO interface, plus a few others.

This module can be a drop-in replacement for BytesRandom, with the primary enhancement of using a cryptographic-quality random number generator to create the random data. The random_bytes function emulates the user interface of BytesRandom’s function by the same name. But with BytesRandomSecure the random number generator comes from MathRandomISAAC, and is suitable for cryptographic purposes. The harder problem to solve is how to seed the generator. This module uses CryptRandomSeed to generate the initial seeds for MathRandomISAAC.



Checkout these related ports:
  • Zzuf - Transparent application input fuzzer
  • Zlint - X.509 certificate linter
  • Zeronet - Decentralized websites using Bitcoin crypto and BitTorrent network
  • Zenmap - GUI frontend for the Nmap scanning utility
  • Zeek - System for detecting network intruders in real-time
  • Zaproxy - The OWASP zed attack proxy
  • Yubioath-desktop - GUI for displaying OATH codes with a Yubikey
  • Yubikey-personalization-gui - Graphical YubiKey personalization tool
  • Yubikey-manager-qt - Cross-platform application for configuring any YubiKey
  • Yubikey-agent - Seamless ssh-agent for YubiKeys
  • Yubico-piv-tool - Yubico PIV tool
  • Ylva - Command line password manager and file encryption program
  • Ykpers - Library and tool for personalization of Yubico's YubiKey
  • Ykclient - Yubico C client library
  • Yersinia - Layer 2 vulnerability scanner (switches, spanning tree, 802.1q ...)