Home All Groups Group Topic Archive Search About

Encrypting short data w/ asymmetric cipher

Author
15 May 2005 12:24 PM
Henry Pootel via .NET 247
Hi, I have some C# code to encrypt a small amount (128 bits) of data using RSA (it uses the RSACryptoServiceProvider).  However, the ciphertext generated is 1024 bits.  (Of course, when I use AES to do the same thing, the ciphertext is 128 bits.)  This may be a limitation of RSA, in general---I don't know.  Is there a way to get the MS RSA implementation to generate encrypted data that is the same size as the plaintext?  Is there another asymmetric cipher supported by MS that will yield ciphertext that is the same size as the plaintext?  In my case, I need 128 bit values that, when encrypted, are still 128 bits.

Thanks!

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>l7vcrz1Us0iTH8SWrERULQ==</Id>

Author
15 May 2005 6:10 PM
Valery Pryamikov
Hi,
RSA ciphertext is always the same size as the size of the key. ElGammal
chiphertext is two times as big as the size of key, Cramer-Shoup is three
times as big...
For shorter size of ciphertext blocks with asymmetric encryption you can ECC
schemes (ex. generic ElGammal with ECC has ciphertext size ~ keysize*2 .
i.e. with 164 bit ECC key it will be 328 bit cipher text) or NTRUEncrypt -
that could give cipher blocksize something around 300 bits (I'm not quite
sure about exact blocksize).
AFAIK - none of existing asymmetric encryption schemes could give you block
size that you are after.

-Valery.
http://www.harper.no/valery

"Henry Pootel via .NET 247" <anonym***@dotnet247.com> wrote in message
news:OA167jUWFHA.1224@TK2MSFTNGP10.phx.gbl...
Hi, I have some C# code to encrypt a small amount (128 bits) of data using
RSA (it uses the RSACryptoServiceProvider).  However, the ciphertext
generated is 1024 bits.  (Of course, when I use AES to do the same thing,
the ciphertext is 128 bits.)  This may be a limitation of RSA, in
general---I don't know.  Is there a way to get the MS RSA implementation to
generate encrypted data that is the same size as the plaintext?  Is there
another asymmetric cipher supported by MS that will yield ciphertext that is
the same size as the plaintext?  In my case, I need 128 bit values that,
when encrypted, are still 128 bits.

Thanks!

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>l7vcrz1Us0iTH8SWrERULQ==</Id>