hyperledger-labs / agora-glass_pumpkin

agora-glass_pumpkin
https://wiki.hyperledger.org/display/labs/Agora
Apache License 2.0
21 stars 11 forks source link

Why large minimum bit length? #13

Open BartMassey opened 2 years ago

BartMassey commented 2 years ago

I am using glass_pumpkin for a teaching demo, and really just want 32-bit primes. Is there some reason for the restriction to 128 bits or more? Sure would be great to remove it for my use case.

mikelodder7 commented 2 years ago

Mostly it’s because for cryptographic means anything smaller is insecure. You could use my cunningham_chain project which will do any size.

BartMassey commented 2 years ago

I figured that must be it. 128 is already too small for modern crypto, though? Probably 512 is as small as it should go in that case, maybe 1024.

Any chance of taking a PR to provide an "insecure_prime" path or somesuch? Right now I'm just generating random odd numbers and testing them with safe_prime(), which seems a little silly.

mikelodder7 commented 2 years ago

Probably wouldn't hurt. 128 is useful for ECC crypto with hyperelliptic curves but anyone doing RSA like primes knows 128 is definitely too small.