Skip to content

Only 2^64 keys, keys generated using Mersenne Twister & 64-bits of entropy #3

Description

@HarryR

rand.seed(time(nullptr) + *reinterpret_cast<unsigned long*>(openssl_seed));

You're seeding GMP's Mersenne Twister RNG...

With 64 bits...

You should change the function name from generate_secure_private_key to generate_weak_entropy.

In other words, you're discarding 28 bytes of good entropy, to seed a PRNG which can be trivially inverted, to generate 512bits of bad entropy, which is then used as key material!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions