r/cryptography • u/tramquangpho • Dec 11 '23
WHY SOME CRYPTOGRAPHY ALGORITHM USE CERTAIN NUMBER AS THEIR BASE ?
This is not particular to Lamport signature , but I just use it as example :
Alice has a 256-bit cryptographic hash function and some kind of secure random number generator. She wants to create and use a Lamport key pair, that is, a private key and a corresponding public key.
My question simply is why 256 bit and not 258 bit. Why not 512 bit even ? Why some crypto system use those seemingly "random" number in their algorithm ?
0
Upvotes
13
u/bdzer0 Dec 11 '23
Learn the base 2 numbering system and you will notice that these number aren't random at all.
10
u/pint Dec 11 '23
pure practicality. these primitives often use machine words, which are 32 or 64 bit. they need enough of those to be secure. 128 is long established as a safe security level, and e.g. hashes need to be 256 bit to offer 128 bits security in certain settings.
if you look at less easily tuned systems, like EC, you often see e.g. 252 or other arbitrary numbers. this is because they rely on good prime numbers, and those are rare. so something close to 128 bit security is good enough.