You are on page 1of 15

ARAVINDA THEJAS CHANDRA

BASICS OF CRYPTOGRAPHY
• Preliminaries
 Secret VS Public key cryptography
 Types of Attacks
- Known Ciphertext
- Known Plaintext
- Chosen Plaintext
• Elementary Substitution Ciphers
• Monoalphabetic Ciphers
• Polyalphabetic Ciphers
 Vigenere Cipher
 Hill Cipher
 One-time pad
• Elementary Transposition Ciphers
• Other Cipher Properties
• Confusion and Diffusion
• Block Ciphers and Stream Ciphers

ARAVINDA THEJAS CHANDRA


CRYPTOGRAPHY PRELIMINARIES
Cryptography is the science of disguising messages so that only intended recipient
can decipher the received message.
Cryptography helps in message(Data) confidentiality, Integrity, authentication and
Digital signatures.
Plaintext – Original message to be transferred.
Ciphertext-
Ciphertext- Disguised version of plaintext.
E - Encryption function or algorithm
D -Decryption function or algorithm
e-Encryption key
d-Decryption key
C = Ee (P) P=Block of plaintext
P = Dd (C) C=Ciphertext

ARAVINDA THEJAS CHANDRA


SECRET KEY VS PUBLIC KEY CRYPTOGRAPHY
Secret Key Cryptography (Symmetric Key Cryptography)
Sender and receiver share a common key know as Secret Key
So e=d
Encryption C = EK (P)
Decryption P = DK (C) K=Secret Key
Example: DES, AES, Blowfish, RC4

Public Key Cryptography (Asymmetric Key Cryptography)


Two distinct key pairs are used. They are known as Public Key and Private Key
Encryption by Sender A C = EBPu(P)
(P) BPu=Public Key of B
Decryption by Receiver B P = DBPr (C)
(C) Bpr= Private key of B
Example: RSA, ECC(Elliptic Curve Cryptography)

ARAVINDA THEJAS CHANDRA


TYPES OF ATTACKS
Cryptographic algorithms is secure if cryptanalyst is unable to

 obtain corresponding plaintext from a given Ciphertext


 deduce the secret key or private key
(cryptanalyst is a person who is expert in breaking ciphers)

Known Ciphertext attack


Constructing plaintext or deducing key from ciphertext is referred as
Known Ciphertext attack.
Known Plaintext attack
Deducing Key from plaintext and ciphertext pair. .( plaintext is predicted)
Chosen Plaintext attack
Plaintext is chosen by attacker and induce the sender to encrypt such text.
Now with plaintext and corresponding ciphertext he may deduce the key.

ARAVINDA THEJAS CHANDRA


ELEMENTARY SUBSTITUTION CIPHERS
In substitution cipher each character or bit is substituted by another.

Monoalphabetic Ciphers
• One alphabet is substituted by another alphabet in the set of alphabets {a,b, ….z}
• Totally 26! Permutations.. i.e. 26! Possible monoalphabetic ciphers.
• Simple substitution cipher is one that replaces each alphabet in text by alphabet
which is K positions away. Such a cipher is known as Caesar cipher.
Example: k=3
Plaintext: MEET ME AT HOTEL
Ciphertext: PHHT PH DW KRWHO
Drawback : Can break cipher based on frequency of occurrence of english alphabets.

ARAVINDA THEJAS CHANDRA


AVERAGE FREQUENCY OF LETTERS IN ENGLISH TEXT

ARAVINDA THEJAS CHANDRA


POLYALPHABETIC CIPHERS
Here ciphertext corresponding to a particular character in the plaintext is not fixed.
It depends on its position in the block.
Vigenere Cipher.
Is a polyalphabetic cipher that uses multidigit key K1,K2…….Km. where each are integers. The plain
text is split into non-
non-overlapping block of m characters.
m=Block size and Key size
First letter in the block is replaced by K1 position to the right, second letter in the block by K2
position to the right and so on.

ARAVINDA THEJAS CHANDRA


HIL CIPHER
• Polyalphabetic cipher proposed by Lester Hill.
• Same as vigenere cipher, plaintext is broken into block of size m.
• Key is mXm matrix of integers between 0 and 25.
• Each character in the ciphertext is afunction of all characters in the block.
Let P1,P2, …………….Pm be numeric representation of characters in plaintext.
Let C1,C2,……………..Cm be corresponding characters in ciphertext.
ciphertext.
Mapping is A -> 0 , B-
B-> 1,………… Z-
Z->25

ARAVINDA THEJAS CHANDRA


EXAMPLE
C=PK
P= CK -1

ARAVINDA THEJAS CHANDRA


ONETIME PAD

• Onetime pad is a secure cipher.


• It uses arbitrarily long, random and non repeating sequence of characters called
onetimepad(key).
onetimepad(key).
• Exchanged between communicating parties beforehand using secure offline
channel.
• Onetime pad is random and not reused.
• Key is as large as the message
• Generating and keeping large random pad in a storage is a problem,

ARAVINDA THEJAS CHANDRA


TRANSPOSITION CIPHER
• Transposition Cipher shuffles,rearranges or permutes the bits in a lock of
ciphertext.
ciphertext.
• Number of 0’s and 1’s remains the same after shuffling unlike to substitution
cipher.
• To decrypt the message the recipient would cast the ciphertext in to a matrix,
reverses the column shuffles and then reverses row shuffles.
• Breaking transposition cipher involves guesswork about a plaintext that would
appear in the message and rearrange ciphertext to get it.

ARAVINDA THEJAS CHANDRA


EXAMPLE

ARAVINDA THEJAS CHANDRA


CONFUSION AND DIFFUSION
• Idea of Confusion and Diffusion Proposed by Claude Shannon in 1949.
• Confusion is the property of a ciphertext whereby it provides no clue regarding the
relationship between the ciphertext and the key.
• i.e. using ciphertext it is impossible to deduce the key.
• In Confusion, for a plaintext P ,even a single bit in a key is changed then atleast roughly half
of the ciphertext bits are changed.
• Diffusion is relationship between plaintext and corresponding ciphertext.
ciphertext.
• i.e. a small change in plaintext will significantly change the ciphertext.
ciphertext.
• Change in 1 bit of plaintext will change the ciphertext with a probability of 0.5
• (Probability should not be 0 or 1)
• Substitution function enhances Confusion.
• Transposition function enhances Diffusion.
• Modern Symmetric cryptographic ciphers uses both substitution and Transposition to get
benefit of Confusion and Diffusion.

ARAVINDA THEJAS CHANDRA


BLOCK CIPHERS AND STREAM CIPHERS
In Block Cipher the plaintext is split into fixed size chunks and each block is encrypted
separately.
Typically all blocks in the ciphertext is encrypted using the same key.
Example: DES - 64-
64-bits RSA - 768 bits or more
AES - 128 bits ECC - 200 bits

Stream Cipher operates on bits or bytes. i.e. Plaintext is encrypted as bits or bytes.
Stream Ciphers uses pseudo random keystream
Example: onetime pad
RC4 (used in wireless LAN protocol IEEE 802.11)
RC4 and other stream ciphers are vulnerable to attack.
So Block Ciphers are widely used.

ARAVINDA THEJAS CHANDRA

You might also like