what are the two basic functions used in encryption algorithms?
Two basic functions used in encryption algorithms are substitution and transposition.
Substitution:
In this principle, letters or numbers in plain text are replaced by some other letters, symbols, or numbers. i.e., every element(a group of letters) on the plain text is mapped to some other element.
So by replacing the characters that represent the original message with some random characters, the data becomes unreadable.
The simplest use of substitution cipher is Julies Caesar
Which involves replacing the letter with 3 places further down the alphabet to it.
For example:
Plain text: wedge shaped ball whirling up in the wool
Encrypted text: zhgjh vkdshg edoo zkluolqj lq wkh zrro
Transposition:
In this principle, The letters in the plain text are rearranged. The fundamental requirement is that no information is lost (i.e., that all operations can be reversed).
The most commonly used cipher is the Rail Fence technique,
In this technique, the plain text was written down as a sequence of diagonals and read as rows
For example:
If you want to send a message to a person like
“wedge shaped ball whirling up in the wool”
w d e h p d a l w i l n u I t e o l
e g s a e b l h r I g p n h w o
In So in this technique, the above message can be written down as
“wdehpedalwlinuiteolegsaeblhrigpnhwo”
In the above message, we read off the message in rows leaving the jumbled text.