Minimalistic Approach to Cryptography

October 25, 2022 - Reading time: 6 minutes

Cryptography


Introducing To Terms


What are Cryptology, Crpytography, Cryptography


The short answer:

Cryptology is a science which is interested by secure communication on an insecure communication channel.

Today, all communications passes over unsecured channels like letters, wired and wireless channels which sending data over. So, anyone able to interrupt or listen the message who is in same channel.

Cryptology is encrypting the messages so if anyone get them, the message owner knows they wont able to read.

Usually, Cryptology is seperated by two necessary parts for cryptology.

  • Cryptography is dealling with dessigning of Cryptosystem or Chipher.

  • Crpytoanalysis is dealling with analysis (cracking) of Cryptosystem or Chipher.

Nowadays, there is no difference with Cryptology and Cryptography and people uses two of them for same mean.

Solved Problems


Crpytography solves some security problems.

Solved Security Problems by Cryptology


  • Encryption

Encryption is provides security on messages and conversations. There is no need to be text, also secures storaged datas too. Chiphers are used for encryption.

  • Integrity

Integrity is about the purity. When you storing or sending data, integrity can be sure about the data not changed or modified. Integrity provides by using hash functions.

  • Authentication

Authentication is verifies the contacts or data ids. Electronic signature also using for authentication process but sometimes the sent datas are need to be verified for is the received data modifed or message is comming from desired contact and the Public-key cryptography provides it.

  • Non-repudiation

Transaction is non-repudiation. User can't denied transaction because only one user has private key and if uses it at the transaction. The Public-key crpytography provides us electronic signatures which them are private and public keys so we can use them for identification. The crypto-assets like Bitcoin, Ethereum uses it for non-repudiation.

Cryptosystem or Chipher?


What is Cryptosystem or Chipher?


  • Plain text

Plain text is the data which is we want to protect. It can be a file on computer or sent messages.

  • Encrpyted text Encrypted text is chipher output after feed by plain text.

  • Cryptosystem/Chipher

Plain text to encrpyted text, encrypted text to plain text converter algorithms.

  • Key Key is a secret information which used by chipher to make it private.
How encrypted message looks like?

We are expecting secure to message so we need to secure chipher for that. If we used a secure chipher to encryption, expected output is pseuderandom character series.

Diagram


Plain Text > Chipher Algorithm > Encrypted Text > DeChipher Algorithm > Plain Text

Historical Ciphers


If we look close to historical ciphers, we'll see they all are basic ciphers cause they belongs before the machines.

They need to be designed as difficult as solved by mind. Usually using alphabetical shifting methods as ciphers. Spaces and symbols are removed for prevent information leak,

Caesar Cipher


Caesar cipher is classical example of historical ciphers. It's named by Julius Caesar and it using old Rome. The technique works like: Every letter shifting by k. For a example if we chose k = 2 the B letter equals to Z or D equals to B in English alphabet.

Alphabet: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z

Key: C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A, B

Weakness of Caesar

  • Key is predictable (The space of key is so tiny).

  • Getting just only plain-encrypted data enough to crack key.

Monoalphabetical Swap


There is more powerful cipher exist. It's named as Monoalphabetical Swap. The cipher using pre-deffiened alphabet space as a key and encrypting the message by swaping the letters.

Alphabet: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z

Key: K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A, B, C, D, E, F, G, H, I, J

Total : 26! = 4.032914611×10²⁶ key space.

It's not so easy to crack with brute force. But there is a ways to crack it. For example, we can use a frequency analysis to find the key. If we know the frequency of letters, we can find the key.

Frequency Analysis


This method discovered at 9th century by Al-Kindi. He is wrote this in him book called A Manuscript Deciphering Crpytographic Messages and its first known crpytoanalysis book in history. This method based on the frequency of letters in the language.

The method:

  • Find a long document in the spesific language. And count the frequency of letters in the document.

  • If we do it on English, we will see the most common letters are ordered by ussage like that:

E, T, A, O, I, N, S, R, H, D, L, C, U, M, P, F, Y, W, G, B, V, K, X, Q, J, Z, M, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z.

And if we count the frequency of letters in the encrypted message, the most common letters are same.

Binary Swap Cipher


The all other ciphers are cracked, so we need to more difficult ciphers.

Playfair Cipher


Cipher recommended by Charles Wheatstone in 1854. The cipher used in World War I. Before the machines, the cipher crackable. So at the war, a lot of encrypted messages were cracked.

Technique:

  • The cipher is based on the playfair square.

  • The square is made of five rows and five columns.

Because of English alphabet has 26 letters.

  • The letters in the square are ordered by the sorted.

  • For ussage enough to learn key and system.

  • First write the key.

  • Dont use the same letter in the table.

  • Fill the left behind with letters.

  • I/J can fits same box.

Rules:

  • Every two letters in the message are same or there is only one letter at the end, after first letter, X is added.

  • If two letters are at the same row, they are swapped by right.

  • If two letters are at the same column, they are swapped by down.

  • If two letters aren't at the same row and column, they are swapped by opposite sides.

Example:

Plain Text Key
CYBERSECURITY CRYPTOLOGY
. . . . .
- - - - -
C R Y P T
O L G A B
D E F H I/J
K M N Q S
U V W X Z

Plain Text: CY, BE, RS, EC, UR, IT, YX Encrypted Text: RP, LI, TM, DR, VC, SB,PW

Avoid from frequency analysis


  • Using more then one letter swap.

  • Binary letter swap is not secure enough.

Can be frequency analysis by counting binary letters.

  • Its pretty easy to crack with computers.

Octal letter swap is takes time for today's computers.

Reaction :

Currently there are no comments, so be the first!