Someone I know showed this to me, and I can't put a finger to why it's happening. Am I missing something?
They encrypt the text, and the output is really guessable. $u\to t$, $i\to h$ (it's one letter behind), the $?$ are just spaces.
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.Sign up to join this community
They trick you with the IV. The IV must be the same for encryption and decryption so that the encryption has the functionality that is;
$$ m = D_k(IV,E_k(IV,m))$$ To surprise you, they modify the IV according to their desire but you failed to see that. This is the more general case of the Bit-Flipping attack on the CBC mode.
This attack works because the message has only one block and the change on the IV only modifies the first block. Nothing special there.
Pick a key $K$. Pick a one-block message $m$ and the desired ciphertext $c$. Then compute the IV for CBC as follows:
$$c=E_K(IV\oplus m)\iff D_K(c)\oplus m=IV$$
where $E_K$ is AES encryption under the key $K$ and $D_K$ is the corresponding decryption and $\oplus$ is bitwise XOR.
Now you have the IV that maps $m$ to $c$ under the key $K$ with all three of them being freely choosable.