Sunteți pe pagina 1din 17

Substitution Techniques

Classical Ciphers
Plaintext is viewed as a sequence of elements (e.g., bits or characters)

Substitution cipher: replacing each element of the plaintext with another element.
Transposition (or permutation) cipher: rearranging the

order of the elements of the plaintext. Product cipher: using multiple stages of substitutions and transpositions

Classical Substitution Ciphers


where letters of plaintext are replaced by other letters or by numbers or symbols

or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with ciphertext bit patterns

Caesar Cipher
Earliest known substitution cipher Invented by Julius Caesar Each letter is replaced by the letter three positions further down the alphabet.
Plain:

a b c d e f g h i j k l m n o p q r s t Cipher: D E F G H I J K L M N O P Q R S T U V W u v w x y z X Y Z A B C

Example
Plain text : meet

me after the Ciphertext: PHHW PH DIWHU WKH

party SDUWB

Cryptanalysis of Caesar Cipher


Key space: {0, 1, ..., 25} Vulnerable to brute-force attacks. Major weakness of Caesar cipher is its Predictability

Monoalphabetic Substitution Cipher


Shuffle the letters and map each plaintext letter to a

different random ciphertext letter:

Plain letters:
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

DKVQF I BJWPESC XHTMYAUOLRGZN Plaintext: if we wish to replace letters Ciphertext: WI RF RWAJ UH YFTSDVF SFUUFYA

Homophonic Cipher
One Plaintext alphabet is replaced with fixed alphabet set.
Ex: A is replaced by the set { D,H,P,R}

PolyGram Cipher
Replacement of plaintext happens block-by-block
Ex:

plaintext: Ciphertext:

Hello Hell YUQQW TEUI

Polyalphabetic Substitution Ciphers


A sequence of monoalphabetic ciphers (M1, M2, M3, ..., Mk) is used in turn to encrypt letters.

A key determines which sequence of ciphers to use.


Each plaintext letter has multiple corresponding ciphertext letters.

This makes cryptanalysis harder since the letter frequency distribution will be flatter.

Vigenre Cipher
Simplest polyalphabetic substitution cipher Consider the set of all Caesar ciphers:

{ Ca, Cb, Cc, ..., Cz } Key: e.g. security Encrypt each letter using Cs, Ce, Cc, Cu, Cr, Ci, Ct, Cy in turn. Repeat from start after Cy. Decryption simply works in reverse.

Example

write the plaintext out write the keyword repeated above it use each key letter as a caesar cipher key encrypt the corresponding plaintext letter eg using keyword deceptive key: deceptivedeceptivedeceptive plaintext: we are discovered save yourself wearediscoveredsaveyourself
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ

Hill Cipher
Multiletter cipher Invented by the mathematician Lester Hill in 1929

m successive Plaintext letters encrypted at a time Substitution is determined by m linear equations For each character ,numerical value is assigned a=0,b=1,c=2,..z=25 For m=3,system can be described as follows

Hill Cipher .

3,representing ciphertext and plain text. K is 3x3 matrix, key

Hill Cipher ..
Ex: plain text: paymoremoney

Hill cipher
Ciphertext: LNSHDLEWMTRW
For decryption,

S-ar putea să vă placă și