Processing math: 0%

The Book of Gehn

I found 3 posts.


CTR Bitflipping

Tags: cryptography, matasano, cryptonita, CTR, counter, forgery

August 22, 2019

No much to explain: encryption does not offer any protection against forgery.

– Spoiler Alert! –

We saw this in the CBC Bitflipping post and we will see it again here but this time it will be the CTR encryption mode our victim.


CTR Edit/Inject Plaintext Attacks

Tags: cryptography, matasano, cryptonita, CTR, counter, forgery

May 8, 2019

A CTR-mode cipher turns a block cipher into a stream cipher.

With this, a ciphertext can be edited in place generating enough of the key stream, decrypting and re-encrypting the edited portion.

– Spoiler Alert! –

One can replace part of the plaintext, extend it or even reduce it.

But this beautiful property of a CTR mode (and any other stream cipher) is actually a booby-trap.


Fixed Nonce CTR Attack

Tags: cryptography, matasano, cryptonita, CTR, counter nonce, PRG, chi-square, undistinguishable

December 4, 2018

The Counter mode, or just CTR mode, turns a block cipher into a stream cipher.

More specifically, it builds a pseudo random generator (PRG) from a block cipher and then generates a random string using the PRG to encrypt/decrypt the payload performing a simple xor.

The idea is to initialize the PRG with a different seed each time but if this does not happen, all the plaintexts will be encrypted with the same pseudo random key stream – totally insecure.

– Spoiler Alert! –

Ready to break it?

- Martin Di Paola