What is Symmetric Encryption? (For beginners)

The term encryption means transforming data into a code that can only be read by the party that can decrypt it, which will guarantee confidentiality if the algorithm and key are still secret.

     In other terms, let’s consider two parties, Alice and Bob. Alice wants to message Bob but doesn’t want other people to read the message. Alice will use an algorithm to transform the message into an encrypted code, and this algorithm will use a key in the encryption process.

     Symmetric encryption is the case where the same key used for compression is also used for decryption (which is the reverse of encryption).

We will discuss it briefly by studying a small example using the Cesar cypher algorithm, a simple technique used a long time ago for secret transmission of letters.

     Here is the scenario: Alice needs to send Hello to Bob but doesn’t want anyone to read it in the way, so he encrypts it with a key of 3.

Sender(encryptor): Alice

Reciever(decryptor): Bob

Algorithm: Ceasar cypher

Pre-shared Key: 3

Plaintext: Hello

     The main idea behind this algorithm is to transform characters to numbers, increment the numbers by 3 then transform the numbers back to characters. Since there are only 26 charachters in the English alphabet, we will get the remainder of the division by 26 if the number exceeds 26. If the original number is N and the calculated number is M then M = N + 3 mod 26.

ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567891011121314151617181920212223242526

So Hello will be 8 5 12 12 15

8+3 mod 26 = 11

5+3 mod 26 = 8

12+3 mod 26 = 15

15+3 mod 26 = 18

So the character numbers will be 11 8 15 15 18

Which will translate to KHOOR

Plaintext: Hello

Cyphertext: KHOOR

     Now Bob receives the message and any interceptor on the road could not understand the meaning of KHOOR because it is encrypted. But since Bob has the key then he can decrypt the message.

Using the same key the algorithm is reversed, which means the addition becomes a subtraction and the formula becomes: N = M – 3 mod 26

KHOOR = 11 8 15 15 18

11- 3 mod 26 = 8

8 – 3 mod 26 = 5

15 – 3 mod 26 = 12

18 – 3 mod 26 = 15

8 5 12 12 15 is Hello

     This is the general concept of symmetric encryption, of course, it is more advanced and keys are longer and more secretive, and might only be used once (like one time pads which are equal to the text in length). We will later discuss the asymmetric encryption and more symmetric sophisticated algorithms.

Leave a Reply

Your email address will not be published. Required fields are marked *