How to create 2048 random bits from 256 bits?

339 Views Asked by At

Would merely repeating the same value 8 times be sufficient ? Or is there a more clever approach for doing this ? The 256 bit values would be generated from SHA256 of files.

1

There are 1 best solutions below

3
On

Random numbers for cryptography are a tough subject because you need true random numbers and that is a difficult subject!

However, the method you are suggesting is not sufficient whatsoever for cryptographic purposes.

You should have a look at the NIST Recommendation for Random Number Generation Using Deterministic Random Bit Generators.

Also, you might want to have a look at the "Handbook of Applied Cryptography".

Lastly, you might want to learn about DIEHARDER and TESTU01 for testing the quality of your random bits as you need high entropy source.

If this is for non-crypto purpose, you might want to use Keccak - SHA3 to extend the number of bits.

Regards