0% found this document useful (0 votes)
58 views25 pages

Decipher D Cipher - 2025

The document provides an overview of cryptography, including definitions of key concepts such as encryption, decryption, and various types of ciphers like substitution, Caesar, Affine, and Playfair. It explains how these ciphers work, their historical context, and methods for encoding and decoding messages. Additionally, it discusses the use of XOR operations and double codes for secure communication.

Uploaded by

Ryan Azim Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views25 pages

Decipher D Cipher - 2025

The document provides an overview of cryptography, including definitions of key concepts such as encryption, decryption, and various types of ciphers like substitution, Caesar, Affine, and Playfair. It explains how these ciphers work, their historical context, and methods for encoding and decoding messages. Additionally, it discusses the use of XOR operations and double codes for secure communication.

Uploaded by

Ryan Azim Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Decipher-D-Cipher

Pratyush Sharma
Ryan Azim Shaikh
Cryptography
Cryptography comes from the Greek words kryptós
meaning "hidden/secret" and graphein meaning
"writing".
It is about constructing and analyzing protocols that
prevent third parties or the public from reading
private messages.
Modern cryptography is heavily based on
mathematical theory and computer science.
Encryption and Decryption
 Data that can be read and understood without any
special measures is called plaintext.
 Disguising plaintext in such a way as to hide its
substance is called encryption.
 Encrypting plaintext results in unreadable gibberish
called cipher text.
 The process of reverting cipher text to its original
plaintext is called decryption.
Cipher

 A cipher is a pair of algorithms which creates the


encryption and the reversing decryption.
 Operation of a cipher is controlled by the algorithm
and by a key.
Substitution Cipher
Substituting every plaintext character for a different cipher text
character.

Examples:
 Plain text: abcdefghijklmnopqrstuvwxyz
 Cipher text: phqgiumeaylnofdxjkrcvstzwb
 Plain text: DEFEND THE EAST WALL OF THE CASTLE
 Cipher text: GIUIFG CEI IPRC TPNN DU CEI QPRCNI
Caesar’s Cipher
 It is a type of substitution cipher in which each letter in the
plaintext is 'shifted' a certain number of places down the
alphabet.
 If 'a'=0, 'b'=1, 'c'=2, ... , 'z'=25. We can now represent the
Caesar’s cipher encryption function, e(x), where x is the character
we are encrypting, as:

where is the key (the shift) applied to each letter.


Keywords
 The cipher string can be generated using a keyword.
 For example, if the keyword were ‘Pratyush is God’
 Cipher Text: pratyushigodefjklmnqvwxzbc
 Often when two parties exchanged codes, they would
encode the first word using the cipher of the previous
day. This when decoded would give the keyword for the
rest of the message.
Affine Cipher
 It is a type of substitution cipher in which each letter in the plaintext is
‘multiplied’ by a number and then 'shifted' a certain number of places down
the alphabet.
 If 'a'=0, 'b'=1, 'c'=2, ... , 'z'=25. We can now represent the Affine cipher
encryption function, e(x), where x is the character we are encrypting, as:

where is a multiplicative factor, coprime to 26.

is the key (the shift) applied to each letter.


Affine Cipher
 If 'a'=0, 'b'=1, 'c'=2, ... , 'z'=25. We can now represent the
Affine cipher decryption function, d(x), where x is the character
we are decrypting, as:

where is a multiplicative factor, coprime with 26


k is the key (the shift) applied to each letter
and is the modular multiplicative inverse of a modulo 26,
i.e.,
Hill Cipher
 Hill Cipher uses matrix multiplication to cipher chunk of letters of size .
 A key for Hill cipher is a matrix of size n*n.
 Blank spaces at the end of sentence in chunks are filled with infrequent letters such as X or
Q.
 Example:

where det(K) !=0 and not divisible by 2 or 13

[A T T] = [0 19 19]

= ‘PFO’
Atbash Cipher:
 A substitution cipher where the letters of the alphabet are reversed i.e.
all 'A's are replaced with 'Z's, all 'B's are replaced with 'Y's, and so on.
 Example:
 Plain text: ATTACK AT DAWN
 Cipher text: ZGGZXP ZG WZDM
Transposition Cipher

 A method of encryption by which the positions held by units of plaintext are shifted according to a regular system
that is, the order of the units is changed.
 A simple example is to reverse the order of the letters in a plaintext. "a simple example" becomes "ELPMAXE ELPMIS A.”
 Another example consists of writing the text in chunks of 5 letters with one chunk below the other and reading
columnwise

Plain Text: MEET ME SOON

MEETM
ESOON

Cipher Text: ME ES EO TO MN
Vigenère and AutoKey Ciphers

Once considered unbreakable ciphers.


Uses a 26*26 custom table or tabula recta.
Tabula recta:
Vigenère and AutoKey Ciphers

 For Vigenère cipher, a key is repeated all along the length of


plain text, thus assigning each plain text a key character.
 Cipher text for a plain text is then the text present in the column
and row to corresponding to key character and plain text
character respectively.
 Example:

 The key repeats itself. This property has been exploited to design
a method to break vigenère cipher.
Vigenère and AutoKey cipher

 In auto key cipher the key is not repeated but instead it is concatenated with the
plain text and then this is run all along the plain text, thus avoiding the repetition.
 Example:
Plaintext: ATTACK AT D AWN…
Key: QUEENL YA T T ACK AT
DAWN
Ciphertext: QNXEPV YT WT WP …

 First auto key cipher has defect that it did not use key but for all the letters in a
word the key character is the first letter of the word.
 Thus it was as difficult for the receiver as anyone else to decipher the cipher text.
 Notice how Vignère and AutoKey are different from Substitution codes, the
position of the character in a message matters.
Playfair Cipher
 The First practical "digraph" substitution cipher. Invented by Charles Wheatstone
but named after Lord Playfair who promoted the use of cipher.
 The key is 5*5 square which is built using a key word.

 Start filling the key square by the key word and discard the letters which are
repeated and then fill the rest with the remaining letters in alphabetical order.
 KEY :- PLAYFAIR EXAMPLE

 i and j are clubbed.


Playfair Cipher
 To encrypt the plain text it broken into digraphs. If left with a single character,
complete it with infrequent one like X.
 Now each digraph is replaced by its own cipher text.
 Locate letters in the digraph in the key square and follow the following rules
to find the corresponding cipher text.
Example:
Plain text: "Hide the gold in the tree stump"
Digraphs : HI DE TH EG OL DI NT HE TR EX ST UM PX
If in a digraph the letters are repeated then replace the later with
infrequent letter (X above).
Playfair Cipher
Rules for finding cipher text using the key square:
 If both letters are the same (or only one letter is left), add an "X" after the first
letter. Encrypt the new pair and continue.
 If the letters appear on the same row of your table, replace them with the letters
to their immediate right respectively.
 If the letters appear on the same column of your table, replace them with the
letters immediately below respectively.
 If they are not in same row or column, replace them, in same order , with the
letters in same row but at the other corner of the rectangle defined by the
letters in digraph as corners.
Playfair Cipher
Example:
Digraph: HI
Playfair Cipher
Example:
Digraph: DE
Playfair Cipher
Example:
Digraph: EX

Following the above rules


Plain text : HI DE TH EG OL DI NT HE TR EX ST UM PX
Cipher text : BM OD ZB XD NA BE KU DM UI XM MO UV IF
XOR Ciphers
 The XOR operation is a very useful tool with a number of interesting properties.
 The XOR of two binary digits is given by this table alongside.
 The XOR of two binary sequences of length k is the digit wise XOR
For example: 1011 ^ 0110 = 1101. A B A^
B
 XOR is commutative and associative. The identity element of XOR is 0 and the XOR
0 0 0
inverse of any sequence is the sequence itself.
0 1 1
So for example: A ^ B = B ^ A = B ^ C ^ A ^ C = A ^ C ^ C ^ B
1 0 1
 To use the XOR cipher to encode letters people often use the ASCII encoding. But to
1 1 0
keep things simple for all our purposes we will map A, B, C … to 0, 1, 2 … and convert
to 5 digit binary integers. So
A = ‘00000’, H = ‘00111’, Z = ‘11001’, etc.
 To complete the code we will append the digits 0, 1, 2, 3 and 4 with 0 = 26, 1 = 27 and
so on. This is so that the cipher text can be represented neatly with one character for
each character in the plain text.
Double Codes

 Suppose there are a sender and a receiver who want to exchange a message.
Both of them have a cipher, say A, for the sender and B for the receiver. They
do not know much about the other persons cipher. All they know is that the
two ciphers commute, i.e. for any string s

 Ciphers are nearly invertible and so notice that


Double Codes

 Now to send a message s the sender and receiver can set up a system in
which
 The sender applies on and transmits
 The receiver now applies on and returns
 The sender now applier on and transmits
 Finally the receiver applies to get the final message .
 Every time an encrypted sentence is transmitted, there is no transmission of
keys or other sensitive data. The sender may use the same cipher A to
communicate with other people and none of them will be able to snoop on
each others conversation.
THANK YOU!

You might also like