elgamal encryption question
"jrandom" <auto97841-revL73yDgGBWk0Htik3J/[email protected]> Tue, 26 Aug 2003 09:05:53 -0700
| Newsgroups | gmane.comp.security.invisiblenet.iip.devel |
|---|---|
| Message-ID | <[email protected]> |
given a 2048bit public key, if I want to encrypt ~70 bytes of data, what is the largest and smallest byte size of the encrypted value that can result? 512bytes, 514 bytes? if the size that comes out is not constant, how should it be padded so that the structure is? if I pad the data being encrypted to 256 bytes (or 255 or 257), will that 1) improve the security of a known plaintext attack or 2) affect the resulting size of the encrypted block? please see datastructures.sxw page 13 for the block in question. Current implementations, as well as a test with bouncycastle.org's elgamal encryption engine, shows that using a 512byte block /usually/ works, but sometimes fails to decrypt correctly. from handbook of applied crypto p296: "A disadvantage of ElGamal encryption is that there is message expansion by a factor of 2. That is, the ciphertext is twice as long as the corresponding plaintext." That seems to tell me that if we want the ciphertext to be 512 bytes, we pad the plaintext to 256 bytes. but it also seems to say that if the ciphertext is just 70 bytes, the plaintext will be 140 bytes, not 512. this needs to be resolved asap, as if a 2048bit key can legitimately encrypt ~70 bytes of data to a resulting 514 bytes instead of 512, the spec needs to change. i'm going out to breakfast and will keep hacking on this when i get back. gracias srs, -jr Concerned about your privacy? Follow this link to get FREE encrypted email: https://www.hushmail.com/?l=2 Free, ultra-private instant messaging with Hush Messenger https://www.hushmail.com/services.php?subloc=messenger&l=434 Promote security and make money with the Hushmail Affiliate Program: https://www.hushmail.com/about.php?subloc=affiliate&l=427 _______________________________________________ iip-dev mailing list [email protected] http://lists.invisiblenet.net/mailman/listinfo/iip-dev