Reduce the length of cipher text generated from RSA algorithm

1.6k views Asked by At

I am generating a cipher text using RSA algorithm and it's working fine. But the thing is, I the cipher text generated is very high.

For example:

Plain text : 249488213

gets generated to,

Cipher text : 94489103D862769B7AE21EA42C2D400A584D0F919BBCAE2450AD1BE57EAC64E4A2F75FAB9F8FA25BCBC12AAAE58F43CCB071DC002332FF4C736F4DA96A36C3ED

which is too large for my use-case as it increase the file size of my plain text file to approx 2.5 times greater.

So my concern is, can we reduce the length of cipher text to some minimum length (despite of key size we use), or is there any other asymmetric algorithm that can help me achieve this.

Any help is appreciated. Thanks.

1

There are 1 answers

0
divanov On BEST ANSWER

RSA encryption is described as

c = m^e mod N,

where c is a cipher text, m is an original message, e is public exponent (typically 65537) and N is public modulus.

Thus, c is always smaller than N, but in most of the cases of the same order as it. Sure you can select N and m to get a small c, but this will obviously lead to make encryption weaker, and you need a special key for every message.

Probably, the same problem will be with other assymetric cryptosystems. Shorter cipher text is easier to recover. But you can use AES, which can produce in counter mode a cipher text of the same size as an original message. Which reveals size of the message to the attacker.