In previous examples , the one time pad had vulnerability if the key used for encryption , is used multiple times . The symmetric cipher algorithms provide an alternative algorithm , an alternative way to encrypt the useful information.
Symmetric Encryption
uses the same key to encrypt and decrypt data .
The Ancient Ciphers like Caesar Cipher , and the one time pad are famous examples of symmetric ciphers , these could further be classified into stream and block ciphers based on the way of processing the data i.e. processing the data in blocks
or one character
at a time.
It is one of the most primitive type of encryption algorithm
It involves the basic shift of the alphabets , by a constant factor , all the letters are displaced , such that it forms a cycle.
Algorithm :
One could simply see from the fact that , say we have j = ( i + K ) % 26 , therefore for some integer L and some key K of the cipher , we can say ,
i + K = L*26 + j , or simply ,
i = L*26 + j - K ,
as i is in range of 0 - 25 ,
i % 26 = i = 0 + ( j - k ) % 26
This cipher is easily breakable , as there are effectively only 26 keys [0-25] available for the Caesar cipher , as after performing the mod operation any random integer chosen as key falls into the range [0-25]. And hence , given the cipher text and the given message , one could simply generate the key for the given cipher system and hence , it doesn't provides for much of the protection.
Scope for improvement The number of possible keys that could be generated , could be increased from 26 to some large number , so that the key for the cipher isn't compromised easily.This could be achieved by using one or more of the following techniques :
crypto-mania-/Symmetric Ciphers at main · KarmanjyotSingh/crypto-mania-
CAESAR CIPHER
XOR operation defined by the symbol ⊕ , that operates on single bits or boolean values. Which is
1 ⊕ 1 = 0
1 ⊕ 0 = 1
0 ⊕ 1 = 1
0 ⊕ 0 = 0
Following are the arithmetic properties of the XOR operator :
Associative : a⊕(b⊕c) = (a⊕b)⊕c
Commutative : a ⊕ b = b ⊕ a
Any bit XOR itself is 0: a ⊕ a = 0. If a is 0, then itʼs 0 ⊕ 0 = 0; if a is 1, then itʼs 1 ⊕ 1 = 0.
Any bit XOR 0 is that bit again: a ⊕ 0 = a. If a is 0, then itʼs 0 ⊕ 0 = 0; if a is 1, then itʼs 1 ⊕ 0 = 1
XOR
operation , could be used for developing secure encryption techniques like the one-time-pad
that offer high degree of security , as we'll see ahead.