An in-depth review of blockchain - cryptography and metaverse (part seven- cryptography - Caesar encryption - Polyalphabetic Substitution )

An in-depth review of blockchain - cryptography and metaverse (part seven- cryptography - Caesar encryption - Polyalphabetic Substitution )

Caesar encryption

Historically it is said that Caesar was the first person in history to introduce cryptography, although I don't think so, about 3000 years before Christ, the Phoenicians in Iran established cryptography to send messages and exactly the same method was used by Caesar without modifications, after the rise of Islam, Arab scientists in the service of the caliphs built an Arabic cipher that altered voiced and unvoiced letters,i won't explain this part of the article in detail as it really doesn't have much encryption value, I'll just briefly explain the important things.

Caesar encryption algorithm

The Caesar encryption algorithm has the following characteristics:

  • ⦁ The Caesar encryption technique is a simple and easy encryption technique.
  • ⦁ This password is simple.
  • ⦁ Each letter of the plaintext is replaced by a letter that has a fixed number of places in the alphabet.

The diagram below shows how the Caesar encryption algorithm works

No alt text provided for this image

decipherment and security

The Caesar cipher is easily cracked even with a plaintext attack. The following two situations come into consideration:

The attacker knows or suspects that some type of simple surrogate cipher was used, but does not know for sure that it is a Caesar cipher.

The attacker knows that the Caesar cipher was used, but does not know the amount of the transfer.

In the first case, it is simply fruitful to use common techniques for breaking surrogate ciphers, such as B. the frequency analysis. When using these techniques, the attacker easily notices the order in the replacement system and the use of the Caesar cipher.

Cracking the password in the second case is easier than in the first case. Since the possible number of transitions is limited (in English 26 possible states), applying an exhaustive search attack and testing all possible states is a quick matter. For example, as shown in the table, a piece of text is written with all possible transitions, and the line containing the meaningful text is easy to identify. In this method, it is sufficient to write all the letters of the alphabet, in sequence, under each letter of the ciphertext. In the example of the preceding table, the ciphertext is EXXEGOEXSRGI, and it is easy to see that this is the encryption key that was used same 4.

Another method is the exhaustive search attack using frequency analysis. With this method, by comparing the letter frequency in the code text and the letter frequency in the normal texts of the language used and shifting the two graphs, the amount of transmission can be found. For example, in the English language, E and T are the most commonly used letters, and Q and Z are the least used letters. This method can also be implemented by computers. To do this, it is sufficient to compare the given distribution with the expected distribution using the chi-square test.

Polyalphabetic Substitution - Vigenere

It is possible to use several alphabets instead of one alphabet as in Caesar. That

in the Middle Ages very popular method called Vigenere uses a key word eg: safe. At Vigenere, the encryption and decryption can be described similarly to the Shift or Caesar cipher. The keyword S(K=18) I(K=8) C(K=2) H(K=7) E(K=4) R(K=17) gives the shift of letters, at the corresponding index in the plaintext. That means in the specific case (key: safe), the first letter with Caesar and key 18, the second letter with Caesar and key 8,etc. is encrypted. In the general case that the plaintext is longer than the key, the Ver- and Decryption continued cyclically. Hence the letter with index 7, again with Casear and Key 18 (S), and index 8 encrypted or decrypted with key 8 (I).

For encryption and decryption, the following square has prevailed at Vigenere:

No alt text provided for this image

Vernam-Chipher (Onetimepad und Stromchiffre)

The Vernam cipher is an extension of the Vigenère cipher, in which a key with the same length as the plaintext. Such a procedure applies according to today's standard as unsafe. However, if the key is generated by a cryptographically strong random number generator, Vernam is a stream encryption. The security here depends on the security of the random number generator. If the key is chosen really randomly, it is also called a one-time pad.

No alt text provided for this image

Encryption:

  1. For encryption, each letter in plain text is assigned a number from 0 to 26 (see Table 1).

2. In the second step, the letter is added to the key. (plain text + key)

3. Subtract 26 if the resulting number is greater than 25. Otherwise it remains unchanged.

The reverse process applies to decryption.

Formal definition:

Z26 all numbers from 0 to 25, the alphabet is uniquely assigned as described in Table 1.

Let the key be k ∈ Z26

Encryption: For each letter in plaintext, the following function is applied:

e(x) = (letter + k) mod 26

Decryption: For each letter in the plaintext, the following function is applied:

d(y) = (letter - k) mod 26

No alt text provided for this image

To view or add a comment, sign in

More articles by Mor Monshizadeh

Insights from the community

Others also viewed

Explore topics