Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomizer: always use CSPRNG from OpenSSL #54

Open
wants to merge 1 commit into
base: community
Choose a base branch
from

Commits on Sep 13, 2024

  1. Randomizer: always use CSPRNG from OpenSSL

    The Randomizer class provided an insecure mersenne twister PRNG
    as a convenience method to draw things like PINs and serial numbers
    from it.
    
    I changed this to always use a secure OpenSSL-based CSPRNG.
    
    Furthermore, the OpenSSL PRNG was insecurely seeded from the mersenne
    twister RNG. Fix this, by combining several input sources via a
    cryptographic hash function and seed OpenSSL from it.
    The code now tries to read 256 Bit from different sources and combines
    them, with SHA-512. When OpenSSL aims for 256 Bit security strength,
    seed it with at least 1.5x this security strength.
    
    Please note, that OpenSSL in typical configurations is automatically
    seeded and the seeding strategy here probably did no harm by accident in the
    past.
    
    Signed-off-by: Markus Theil <[email protected]>
    thillux authored and Markus Theil committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    274ee67 View commit details
    Browse the repository at this point in the history