Logo
RSS Feed

Symmetric Algorithms

Viginear

Viginear cypher is more sophisticated than the Caesar cypher. Since the key is several characters long and the length is unknown, the frequency analysis technique becomes more challenging.

Block Ciphers

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.

  • Stream
    • synchronised
    • unsynchronised
  • Block
    • CTR

Encryption steps:

  • 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 🗝

Decryption steps:

Caesar's Cipher

In this article, I’m dissecting a very well-known (and that’s why not advisable to be used) cryptographic algorithm which is better known for IT tribe as “ROT13”.

#todo: https://coderoad.ru/50664321/%D0%9F%D0%BE%D1%87%D0%B5%D0%BC%D1%83-%D0%BA%D0%BE%D0%B4%D0%B8%D1%80%D1%83%D0%B5%D1%82%D1%81%D1%8F-%D1%82%D0%B5%D0%BA%D1%81%D1%82-%D0%B2-%D1%8D%D1%82%D0%BE%D0%BC-%D0%BC%D0%BE%D0%B4%D1%83%D0%BB%D0%B5-ROT13

DES

DES - Symmetric. Data Encryption Standard. NIST 1993. 56 bit key, 64-bit plaintext input (blocks). How secure? Can be brute-forced in 4 months. No known “backdoor” decryption approach. To make it more secure, change keys every 3 months, use 3 keys, use cipher-block chaining.

One-time Pad

One-time pad is like a Viginear cypher but with the key the length of the cypher text.

Algo Intro

The key requirement for this cypher scheme to be perfectly secret is that the key should only be used once. Why? For example, the same key was applied to two cypher texts (c1 and c2), so that c1 = message1 XOR key and c2 = message2 XOR key. What can we do here? We can eliminate the key by XOR-ing c1 and c2: c1 XOR c2 = (message1 XOR key) XOR (message2 XOR key) = message1 XOR message2. This is not the same as having the plain text of either or both message1 or message2, but there is something we can do, using ASCII characteristics (it’s if it were ASCII, of course). Each letter starts with 01 in binary, but the space character starts with 00. Look at the possible combinations: