You are on page 1of 2

 Cryptography involves using techniques to obscure a message so outsiders

cannot read the message. It is typically split into two steps:


 Encryption and decryption.
Encryption, in which the message is obscured, and
Decryption, in which the original message is recovered from the obscured form.
 Substitution Cipher
A substitution cipher replaces each letter in the message with a different
letter, following some established mapping.
 Example: Caesar cipher, sometimes called a shift cipher.
Encrypt : "Have a nice day "   using shift 3
Use the substitution table
A B C D E F G H I J
D E F G H I J K L M
 
K L M N O P Q R S T
N O P Q R S T U V W
 
U V W X Y Z
X Y Z A B C
 
To encrypt:  HAVE A NICE DAY
H A V E A N I C E  

K D Y H D Q L F H  
 
D A Y              
G D B              
KDY HDQ LFH GDB
To decrypt a message , use backward substitution
Example: decrypt  KDY HDQ LFH GDB using shift 3
K ⟶  H        from K count 3 letters backward (3 letters to the left of K which is H)
D⟶  A        from D count 3 letters to the left of D 
Y⟶  V  
H⟶   E   
D⟶  A       G⟶  D 
Q⟶  N    D⟶   A   
L⟶   I      B⟶   Y
 F⟶  C   
 H⟶  E     
Message:    Have a nice day

Example 2: decrypt    PJJU   XFKJ     shift 5


 count 5 letters to the left of the given letter
P⟶K       J⟶ E     J⟶ E    U⟶ P   X⟶ S     F⟶ A     K⟶ F     J⟶ E
Message: keep safe
TRANSPOSITION CIPHER
A transposition cipher is one in which the order of characters is changed to obscure
the message 
 
Examples
1.  Encrypt the message : Keep calm using transposition cipher of rows of length 2
characters
                                            K    E
                                            E    P
                                            C    A 
                                            L    M
        encrypted message:        KECL    EPAM 
2. Encrypt the message using the key word LOVE  
I LOVE MATHEMATICS
                                 I    L    O    V
                                E    M    A    T
                                H    E    M    A
                                T    I    C    S  
  Encrypted message:    VTAS    IEHT   OAMC    LMEI                                
                                         4th       1st         2nd        3rd 
 
3.  Decrypt using the keyword   CARE:                    EIX   BTT  ANZ  PEY
    CARE (2143)
    2ND    1ST    4TH    3RD
     B         E        P         A
     T        I          E         N 
    T         X         Y         Z
 
MESSAGE:   BE PATIENT

You might also like