Tag Info

Hot answers tagged

3

That is the general idea of it yes. Some modes of operation (eg CTR) work in such a way that only known values are ever encrypted, forming a stream of pseudo-random data that is then combined with the plaintext by a keyless reversible operation (often xor) to form the ciphertext. Other modes (eg CBC) directly encrypt secret (ie plaintext) values, meaning ...


2

I'm not sure if your understanding is correct. However, to explain it a bit to be sure you’re on the right track… Some mode of operation only use an encryption function because it is used to generate something to XOR with the plaintext. There is no point decrypt the generated bytes. To decrypt the ciphertext, you just need the same stream of bytes.


2

The CTR part of CCM is basically the last for loop in the _ctrMode function: for (i=0; i<l; i+=4) { ctr[3]++; enc = prf.encrypt(ctr); data[i] ^= enc[0]; data[i+1] ^= enc[1]; data[i+2] ^= enc[2]; data[i+3] ^= enc[3]; } i.e. CTR is simply: encrypt a counter block with a block cipher, xor the encrypted block into the data, ...



Only top voted, non community-wiki answers of a minimum length are eligible