El Gamal Encryption
Hello,
I am using Bouncy Castle's implementation of El Gamal to encrypt messages. I am trying to encrypt the same message twice. i.e., encrypt the encryption of a message. The issue I encounter is that the length of the plaintext can be at most keyLength-1, while the length of the message I have after the first encryption round is keyLength (not taking into acount the part of the cipher correcsponding to G^xy). What is the reason for that? The El Gamal cryptosystem is semantically secure, therefore, it is not required to add random values to prevent the situation where the same plaintext results in the same cipher text. Can I control the length of the input and set it to maximum of keyLength? Are there providers who implemented El Gamal with maximum plain text for encryption equal to keyLength? Do you have any other suggestions on how to go about encrypting the encryption of a message?
Thank you in advance,
Shay
|