Conventional cryptography
1 / 72

Conventional Cryptography - PowerPoint PPT Presentation

  • Uploaded on

Conventional Cryptography. Classical Encryption Techniques. Topics. Introduction to Cryptography Encryption / Decryption Basic Terminologies Cryptography Types Classical Cryptographic Techniques Stenography Mono-alphabetic & Poly-alphabetic Caesar Cipher Transposition Cipher OTPs

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Conventional Cryptography' - ulmer

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Conventional cryptography

Conventional Cryptography

Classical Encryption Techniques


  • Introduction to Cryptography

  • Encryption / Decryption

  • Basic Terminologies

  • Cryptography Types

  • Classical Cryptographic Techniques

  • Stenography

  • Mono-alphabetic & Poly-alphabetic

  • Caesar Cipher

  • Transposition Cipher

  • OTPs

  • Rotor Machines

Encryption decryption
Encryption / Decryption

  • The process of disguising a message (plaintext) into an unintelligible form (ciphertext) by an encryption algorithm and a secret variable, called a key

  • The process of transforming ciphertext back into plaintext using the encryption algorithm and a key


  • Cryptography is the study of secret (crypto-) writing (-graphy) concerned with developing algorithms which may be used to:

    • Conceal the context of some message from all except the sender and recipient (privacy or secrecy), and/or

    • Verify the correctness of a message to the recipient (authentication or integrity)

  • Basis of many technological solutions to computer and communications security problems.

  • Cryptography may be part of a security solution, but it is never the whole solution. At best, it transforms a more general security problem into a key management problem.

Crypto systems classification
Crypto Systems Classification

  • Two requirements for secure use of symmetric encryption:

    • a strong encryption algorithm

    • a secret key known only to sender / receiver

      Y = EK(X)

      X = DK(Y)

  • Assume encryption algorithm is known

  • Implies a secure channel to distribute key

  • The way in which the plaintext is processed

    • Block cipher

    • Stream cipher

History of cryptography
History of Cryptography

  • Ancient Cipher

    • Have a history of some 4000 years

    • Ancient Egyptians encoded some hieroglyphic writings on monuments

    • Ancient Hebrews enciphered certain words in the scriptures using the ATBASH cipher

    • Greek writings show the first discussions of the use of secret writings.

Basic terminologies
Basic Terminologies

  • cryptology

    • the field encompassing both cryptography and cryptanalysis

  • cryptography

    • the art or science encompassing the principles and methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back to its original form.

  • cryptanalysis (codebreaking)

    • the study of principles and methods of transforming an unintelligible message back into an intelligible message without knowledge of the key.

  • plaintext

    • the original intelligible message

  • ciphertext

    • the transformed message

Basic terminologies contd
Basic Terminologies (Contd.)

  • cipher

    • Mathematical algorithm for transforming an intelligible message into unintelligible by transposition and/or substitution methods

  • key

    • Critical information used by the cipher, known only to the sender & receiver

  • encipher (encrypt)

    • the process of converting plaintext to ciphertext using a cipher and a key

  • decipher (decrypt)

    • the process of converting ciphertext back into plaintext using a cipher and a key

  • code

    • an algorithm for transforming an intelligible message into an unintelligible one using a code-book

Symbols used
Symbols Used

P plaintext

C ciphertext

E encryption function

D decryption function

E(P) = C encrypting plaintext yields ciphertext

D(C) = P decrypting ciphertext yields plaintext

D(E(P)) = P decrypting encrypted plaintext yields plaintext

K Key

Cryptographic concept
Cryptographic Concept

  • Encryption C = EK(P)

  • Decryption P = EK-1(C)

  • EK is chosen from a family of transformations known as a cryptographic system.

  • The parameter that selects the individual transformation is called the key K, selected from a keyspace K.

The key
The Key !

  • All modern algorithms use a key to control encryption and decryption

  • The key used for decryption can be different from the encryption key, but for most algorithms they are the same.

Key management problems
Key Management Problems

  • Key management is the hardest part of cryptography

  • Two classes of keys

    • Short-term session keys (sometimes called ephemeral keys)

      • Generated automatically and invisibly

      • Used for one message or session and discarded

    • Long-term keys

      • Generated explicitly by the user

  • Long-term keys are used for two purposes

    • Authentication (including access control, integrity, and non-repudiation)

    • Confidentiality (encryption)

      • Establish session keys

      • Protect stored data

Key lifetimes and key compromise
Key Lifetimes and Key Compromise

  • Authentication keys

    • Public keys may have an long lifetime (decades)

    • Conventional keys have shorter lifetimes (a year or two)

  • If the key is compromised

    • Revoke the key

  • Effects of compromise

    • Authentication: Signed documents are rendered invalid unless time-stamped.

    • Confidentiality: All data encrypted with it is compromised.

Cryptography types
Cryptography Types

  • Symmetric cryptography

    • Use the same key for encryption and decryption

  • Asymmetric cryptography

    • More popularly known as Public Key Cryptography

    • Use different keys for encryption and decryption


  • Cryptanalysis is the process of breaking an encrypted message without knowledge of key

  • Several different types of attacks can be identified:

    • Ciphertext only

      • only known: algorithm and some ciphertext

      • use statistical attacks only

      • Purpose is to recover plaintext and/or key

      • must be able to identify when have plaintext

    • Known plaintext

      • know (or strongly suspect) some plaintext-ciphertext pairs

      • use this knowledge in attacking cipher and recover key

Cryptanalytic attacks contd
Cryptanalytic Attacks Contd..

  • Chosen plaintext (differential cryptanalysis)

    • can select plaintext and obtain corresponding ciphertext – more powerful than known plaintext attack

    • Picks patterns that may reveal info/structure of key

  • Chosen ciphertext (less probable attack)

    • can select ciphertext and obtain corresponding plaintext

  • Chosen plaintext-ciphertext (Chosen Text)

    • can select plaintext and obtain corresponding ciphertext, or select ciphertext and obtain plaintext


  • Cryptology is the branch of mathematics that studies the mathematical foundations of cryptographic methods.

  • Cryptology comes from the Greek words Kryptos, meaning hidden, and Graphen, meaning to write. Cryptology is actually the study of codes and ciphers.

  • Cryptology = both cryptography and cryptanalysis

Algorithm secrecy
Algorithm Secrecy

  • Some cryptographic methods rely on the secrecy of the algorithms; such algorithms are only of historical interest and are not adequate for real-world needs.

  • Kerchoff’s Principle: If the strength of your new cryptosystems relies on the fact that the attacker does not know the algorithm's inner workings,you are sunk.

    Security through Obscurity Does Not Work !!!

Cipher security
Cipher Security

  • unconditional security

    • With all computing power available, the cipher cannot be broken since the ciphertext provides insufficient information to uniquely determine the corresponding plaintext

  • computational security

    • given limited computing resources (eg time needed for calculations is greater than age of universe), the cipher cannot be broken within the useful lifetime of the information


  • Simply takes one piece of information and hides it within another.

  • Stenography can also be used to place a hidden "trademark" in images, audio, and software, a technique referred to as watermarking.

  • More



Classical cryptographic techniques
Classical Cryptographic Techniques

Two basic components in classical ciphers:

substitution and transposition

  • Substitution ciphers - has letters replaced by others

    • Monoalphabetic

    • Polyalphabetic

  • Transposition ciphers - has letters arranged in a different order

Caesar cipher history
Caesar Cipher – History

  • A Monoalphabetic Substitution Cipher

  • 2000 years ago Julius Ceasar used a simple substitution cipher, now known as the Caesar cipher

  • First attested use in military affairs (Gallic Wars)

  • General Caeser Algorithm

    • C = E(p) = (p + k) mod (26)

    • p = D(C) = (C – k) mod (26)

  • Replace each letter by 3rd letter on, eg.

    • e.g. SSUET is cipher as V V X H W

Ceasar cipher contd
Ceasar Cipher (contd.)

  • More generally can use any shift from 1 to 25

    • i.e. replace each letter of message by a letter a fixed distance away

  • Specify key letter as the letter a plaintext A maps to

    • e.g. a key letter of F means

    • A map A to F, B to G, ... Y to D, Z to E

      • i.e. shift letters by 5 places

  • Hence have 25 useful ciphers

Example caesar cipher
Example: Caesar Cipher

  • Replace each letter of message by a letter a fixed distance away

  • e.g. use the 3rd letter on


    • i came i saw i conquered (Plain)

  • i.e. Mapping in above case is as



  • Caesar Cipher as:

    • Encryption Ek : i -> i + k mod 26

    • Decryption Dk : i -> i - k mod 26

Cryptanalysis caesar cipher
Cryptanalysis: Caesar Cipher

  • Exhaustive key search

  • Given some ciphertext, just try every shift of letters:


  • Class Room Task

    • Break ciphertext "GCUA VQ DTGCM"

Arbitrary substitution
Arbitrary Substitution

  • A dramatic increase in the key space is achieved by allowing an arbitrary substitution.

  • There will be 26! or greater than 4 x 1026 possible keys.

  • The cryptanalysis can be exploited after looking at the regularities of the language.

    • This approach is referred as Frequency Distribution Cryptanalysis.

Monoalphabetic cipher contd
Monoalphabetic Cipher contd.

  • Monoalphabetic substitution ciphers do not change relative letter frequencies

  • Calculate letter frequencies for ciphertext and compare counts/plots against known values.

Example cryptanalysis on monoalphabetic cipher
Example Cryptanalysis on Monoalphabetic Cipher

  • Given ciphertext:

  • Count relative letter frequencies (see text) and guess P & Z are e and t and guess ZW is ‘th’ and hence ZWP is ‘the’ using frequency diagrams.

  • Proceeding with trial and error finally get:

Playfair cipher
Playfair Cipher

  • Not even the large number of keys in a monoalphabetic cipher provides security

  • One approach to improving security was to encrypt multiple letters instead of single letter at a time.

  • This approach will destroy to some extent the frequency structure of the letters.

  • ThePlayfair Cipheris one such example

  • Invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair

Playfair cipher1
Playfair Cipher

  • Invented by Sir Charles Wheatstone, in 1854.

  • Developed for Telegraph Secrecy

  • Based on the 5*5 matrix of letters constructed using a keyword.

  • The matrix is constructed by filling in the letters of the keyword (minus duplicates).

  • Then filling in the remainder of the matrix with the remaining letters in alphabetic order.

  • More…





Playfair rules of enciphering
Playfair: Rules of Enciphering

  • Repeating plaintext letters are separated by a filler letter, such as x.


  • Plaintext letters that fall in same row of the matrix are each replaced by the letter to the right.

    • AR in arch as RM

  • Plaintext letters that fall in same column are each replaced by the letter beneath.

    • MU in mute as CM

  • Otherwise, each plaintext letter is replaced by the letter that lies in its corresponding row and column.

    • SH in shell as PB

      Refer to the matrix given in Text book on page 34.

Using "playfair example" as the key, (assuming I and J are interchangeable) the table becomes:

Encrypting the message "Hide the gold in the tree stump":


Hill cipher
Hill Cipher

  • Developed by the mathematician Lester Hill in 1929.

  • Implemented in the form of a machine using gears and chains like those used with bicycles.

  • The fact that it is impractical for hand use, while it predates the computer age.

  • More



Hill cipher contd
HILL Cipher contd.

  • If the determinant of the key matrix is zero then the inverse does not exist. Hence this key combination can be used for encryption but not decryption. Such keys are called weak keys.

  • E.g.

Hill cipher contd1
HILL Cipher contd.

  • Known plaintext can be used to find the key

Polyalphabetic cipher
Polyalphabetic Cipher

  • An approach to improving security is to use multiple cipher alphabets, hence the name Polyalphabetic ciphers

  • Makes cryptanalysis harder since have more alphabets to guess and because flattens frequency distribution

  • Use a key to select which alphabet is used for each letter of the message

  • ith letter of key specifies ith alphabet to use

  • Use each alphabet in turn

  • Repeat from start after end of key is reached

Vigen re cipher
Vigenère Cipher

  • Simplest Polyalphabetic substitution cipher is the Vigenère Cipher

  • Key is multiple letters long K = k1 k2 ... kd

  • ith letter specifies ith alphabet to use

  • Use each alphabet in turn

  • Repeat from start after ‘d’ letters in message

  • Describe this mathematically as the function:

  • Encryption is done using

    • Eki(a): a -> a + ki (mod 26)

  • Decryption is done using

    • Dki(a): a -> a - ki (mod 26)

Vigen re cipher contd
Vigenère Cipher Contd..

  • Write the plaintext out

  • Under it write the keyword in repetition

  • Use each key letter in turn as a Caesar cipher key

  • Encrypt the corresponding plaintext letter

  • Example




Vernam cipher
Vernam Cipher

  • Introduced by an AT&T engineer named Gilbert Vernam.

  • Uses a keyword that is as long as the plaintext.

  • The key has no statistical relationship to the plain text.

  • This system works on binary data rather than letters.

  • Mathematical representation

    • Pi = Ci XOR ki

Transposition ciphers
Transposition Ciphers

  • Referred as classical Transposition or Permutation ciphers

  • These hide the message by rearranging the letter order without altering the actual letters used.

  • Scheme uses writing message in a rectangle, row by row, and reading the message off, column by column, but permute the order of the columns.

  • The order of the columns then becomes the key to the algorithm.

  • The transposition cipher can be made significantly more secure by performing more than one stage of transposition.

Rail fence cipher
Rail Fence Cipher

  • Write message with letters on alternate rows (of depth ‘n’).

  • Read off cipher row by row

    • Plain: I A E S W C N U R D C M I A I O Q E E


Rail fence cipher geometric figure
Rail Fence CipherGeometric Figure

Defend the east wall of the castle
defend the east wall of the castle

d . . . n . . . e . . . t . . . l . . . h . . . s . . . . e . e . d . h . e . s . w . l . o . t . e . a . t . e . . f . . . t . . . a . . . a . . . f . . . c . . . l .


With key 4
With Key 4

d . . . . . t . . . . . t . . . . . f . . . . . s . . . . e . . . d . h . . . s . w . . . o . t . . . a . t . . . . f . n . . . e . a . . . a . l . . . h . c . . . l . . . . e . . . . . e . . . . . l . . . . . e . . . . . e


Scytale cipher
Scytale Cipher

  • An early Greek transposition cipher .

  • A strip of paper was wound round a staff.

  • Message written along staff in rows, then paper removed.

  • Leaving a strip of seemingly random letters.

  • Not very secure as key was width of paper & staff.

Reverse mirror cipher
Reverse (Mirror) Cipher

  • Write the message backwards



Key concepts for transposition
Key Concepts for Transposition

  • In a transposition cipher the key idea is,

    • Write the message out in columns according to some rule

    • Read the letters off to form the ciphertext according to another rule

    • Key used to find order to:

      • Read off the cipher

      • Write in the plaintext, or

      • Both

Row transposition ciphers
Row Transposition ciphers

  • Group the message and shuffle letters within each group.

  • More formally write letters across rows.

  • Then re-order the columns before reading off the rows.

  • Always have an equivalent pair of keys (Read off vs. Write In)

What is a one time pad otps
What is a One Time Pad? OTPs

  • An improvement to the Vernam Cipher.

  • It is the only currently known unconditionally secure encryption system.

  • Other are cryptographically secure which means that they have a cost associated with breaking, this cost will be very high, but it would theoretically be possible to break if enough compute time could be gathered.

  • OTPs are provably unconditionally secure.

  • Example: Statement in C-language


How does it work
How Does It Work?

  • Basically you have your random OTP, which both you and your intended recipient have. You have a message M, and you compute the ciphertext C by XORing the message with the OTP:

    C = M XOR OTP

  • You send the ciphertext to your recipient, the recipient knowing the OTP also can recover the message by computing the reverse, XORing the ciphertext C with the OTP:

    M = C XOR OTP

  • You must never re-use the OTP, other wise it wouldn't be a "One-Time" pad anymore, and it would loose it's unbreakable properties as information would start to be leaked.

Rotor machines
Rotor Machines

  • A rotor is a small disk of insulating material.

  • Consist of 26 equally-spaced electrical contacts in a circle on each side.

  • The contacts on one side are connected to the contacts on the other side in a scrambled order.

  • Enigma: A Unique Rotor Machine

    • Enigma Rotor Machine, one of a very important class of cipher machines, heavily used during 2nd world war,

    • Comprised a series of rotor wheels with internal cross-connections, providing a substitution using a continuously changing alphabet.