email - Which symmetrical encryption algorithm to use to encrypt e-mail address(short message)? -
Which identical encryption algorithm is used to encrypt an e-mail address (short message)? I would like to keep the ciphertext comparable in the length of the perestext.
Symmetrical block ciphers produce the same length as the input, in multiples of the block size (usually But 8 bytes or 16 bytes for AES). Because the output is always many of the block size (in fact the input is always the same shape as the input and input should be multiple of the block size) so you can not know the basic size of the plain text. Common encryption schemes solve this by adding a padding scheme, such as PKCS, ISO 10126 or ANSI X923, provide information about the length of the original clear text in the last block.
If the size of the explicit text is greater than one of the 8 (16 AES), then another block is added to the encrypted text if the original size is not multiple of the block size, then the encrypted size is next multiple Round up to block size will be rounded.
For this you should add salt value for each record. A salt (or initial vector, to be correct) is the same shape as a block, usually stored in front of an encrypted block
and finally you should sign encrypted values for verification , So you should add one SHA digest, another 20 bytes, otherwise you can not know for sure that the decrypted value is correct.
then the overall size (considering AES): 16 bytes (salt) + (clear text size + 20 (hash)) + (16 - (clear text size + 20)% 16).
John.doe@anydomain.com (number 22) The encrypted size will be 16 + 22 + 20 + (16-10) = 64. To decrypt, you take 16 bytes in the form of salt, 48 decrypt the living, then the output is 42, you eat 42-20 = 22 bytes and the previous 20 bytes of decrypted text compared to the diagram. Compare.
I know that is more than a bargain for you, but every step in this scheme is justified.
Comments
Post a Comment