Score:0

Clarification regarding AES-CTR

tk flag

I was recently trying to perform a AES-128 CTR Encryption and Decryption.

I had a observation that if a AES-CTR encrypted value is encrypted again (with same key and Iv) it results in the plain text that was in encrypted in first place.

Just want to the reason behind this and does any other AES scheme support this similar behaviour ?

Thanks!

poncho avatar
my flag
"does any other AES scheme support this similar behaviour" - OFB mode (which also uses in the 'generate a keystream from the key/IV and xor it into the plaintext to form the ciphertext" paradigm)
Score:1
fj flag

It is correct, and reason is simple - CTR mode basically acts as stream cipher, meaning it creates keystream just from key and IV and then this keystream is bitewise XORed with plaintext.

When you do that same operation again, the first and second XOR counteracts each other and all that remains is plaintext.

first encryption:

ciphertext = plaintext XOR keystream

secound encryption (same key and IV):

ciphertext2 = ciphertext XOR keystream

ciphertext2 = (plaintext XOR keystream) XOR keystream

ciphertext2 = plaintext

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.