This is the next generation. 128-bit blocks, 128,192, 256 keys. It takes too much time to brute force. However, there are some situations when this could be cracked. And not only ECB but CBC as well.
One block of plaintext results in a 2-block cypher (random string + cypher text) for some modes. That’s why different modes exist.
- Choose some random string of length N (call it a 🐊)
- Do something with the string to get a key 🗝 from 🐊
- XOR your message 🍆 with a key 🗝
- Cypher text 🫐 = 🐊, 🍆 XOR 🗝
- c2 XOR Fk(c1)
Let’s start with an example. Let’s say we want to encrypt the message:
explore. If it’s ASCII, it’s 7 bytes long. Let’s translate this into char:
65 78 70 6C 6F 72 65. Since the message needs to be padded to become 8 bytes long and we only have one character to add, we add
01 (see PKCS#5 padding).
Now, we pick an array of random numbers of the same length to make an
IV (initialisation vector):
We first XOR IV with the message to get the following result:
Then we encrypt this newly acquired array with AES (a series of shifting, meddling and xoring).
In the end, we have the following output:
The first 8 bytes are the IV, and the last 8 are the encrypted message. How do we find out what the plaintext has access to the IV and be able to modify it and observe the server response?
some_function(ctr): ... return ctr key_length = 10 number_of_blocks = 4 ctr = random(length=key_length) message = [number_of_blocks] cypher_text = ctr for i in range(0,number_of_blocks): cypher_text += message[i] ^ ctr some_function(ctr += 1)