Simple Substitution Cipher Encryption and Decryption
using a given key of 5 unique letters.
The user enters the key to cipher a message and the same key to decipher the message. The
cipher alphabet is built by adding the remaining 21 letters (excluding the 5 letters entered) in
order after the key letters.
For example, if the user enters "zebra" as the key, then:
- plain 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
- cipher alphabet: z e b r a c d f g h i j k l m n o p q s t u v w x y
The, we can encrypt the following sentence as follows:
Plain text : I love C plus plus
Cipher text: g jmua b njtq njtq
If the user enters "cairo" as the key, then: - plain 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
- cipher alphabet: c a i r o b d e f g h j k l m n p q s t u v w x y z
The, we can encrypt the following sentence as follows:
Plain text : I love C plus plus
Cipher text: f jmvo i njus njus
- The Key letters must be unique and just 5 characters no numbers or symbols.
- Any number or symbols in the message will be deleted in encoding.
- You can use uppercase letters but it will convert to lowercase.