InfoSec Lect5
InfoSec Lect5
Unit 3:
Cryptography and Key Management
Outline
Basics of cryptography
Symmetric Cryptography [Data Encryption Standard
(DES), Triple DES, (Advanced Encryption Standard
(AES) , Key distribution)
Asymmetric cryptography
Public and private keys
RSA (Rivest Shamir Aleman)
Elliptic curve
Hash function
Digital signatures
PKI (Public Key Infrastructure)
Applied cryptography
Why Cryptography?
Cryptography is a component of many security systems
It applies to numerous aspects of the security models
( Confidentiality, Authentication, Integrity, Authorization,
Non-repudiation)
Desired Property Threat Solution
plaintext ciphertext
Alice Encrypt Decrypt Bob
Mallory/ Enemy or
Oscar Eve Adversary
7
Attack Methods
1. Ciphertext only: Alice has only a copy of ciphertext
2. Known Plaintext: Eve has a copy of ciphertext and the
corresponding plaintext and tries the deduce the key.
3. Chosen Plaintext: A chosen-plaintext attack (CPA)
is an attack model for cryptanalysis which presumes
that the attacker has the capability to choose
arbitrary plaintexts to be encrypted and obtain the
corresponding ciphertexts.
4. Chosen Ciphertext: A chosen-ciphertext
attack (CCA) is an attack model for cryptanalysis in
which the cryptanalyst gathers information, at least in
part, by choosing a ciphertext and obtaining its
decryption under an unknown key.
8
Encryption Methodologies
Substitution Cipher
Plaintext characters are substituted to form
ciphertext
“A” becomes “R”, “B” becomes “G”, etc.
Character rotation
• Caesar rotated three to the right
(A > D, B > E, C > F, etc.)
A table or formula is used
ROT13 is a Caesar cipher
Subject to frequency analysis
attack
Transposition Cipher
Plaintext messages are transposed into ciphertext
Plaintext:
A K C N B
ATTACK AT ONCE VIA
NORTH BRIDGE T A E O R
Write into columns going down T T V R I
Read from columns to the right
A O I T D
Ciphertext: C N A H G
AKCNBTAEORTTVRIAOITDCNAHG
Subject to frequency analysis
attack
Mono-alphabetic Cipher
One alphabetic character is substituted
or another
Caesar right-three shift:
Or a more random scheme:
A B C D E F G H I J …Z A B C D E F G H I J …Z
D E F G H I J K L M …C
Subject to frequency analysis attackW E R T B N P Q C U … X
Mono-alphabetic Cipher
Here the cipher can be any permutation of
26 alphabet characters.
More immune to Brute-force
Single cipher alphabet is mapped to plain
alphabet in message.
Distance between plaintext and cipher text is
not same.
Mono-alphabetic Cipher
Problem
Since both Plain Text and Cipher Text are
in English Language
Nature of plain text can be known.
Mono-alphabetic Cipher
.eg Let us try to break the following moalphabetic
cipher using Freq analysis chart for
‘GZGEWVGRNCP’ Freq chart in next slide
CT G Z G E W V G R N C P
Freq 3 1 3 1 1 1 3 1 1 1 1
PT E E E
PT E E T E L A N
PT E X E C U T E P L A N
Try with High frequency text or permutation of text for breaking cipher
Mono-alphabetic Cipher
Disadvantage
• Easy to breakdown using frequency
analysis of english alphabets
Polyalphabetic Cipher
Plaintext A B C D E F G H I … Z
Alpha 1 W E R T B N P Q C … X
Alpha 2 R B I K Q D X U N … E
Alpha 3 V B D R H W A X I … U
Alpha 4 M U T X D G P O W … F
Alpha 5 Y D V B J I K E Z … O
Plaintext A T T A C K A T O N C E V I A N
Key S E C R E T S E C R E T S E C R
Plaintext 0 19 19 0 2 10 0 19 14 13 2 4 21 8 0 13
Key 18 4 2 17 4 19 18 4 2 17 4 19 18 4 2 17
Sum 18 23 21 17 6 3 18 23 16 4 6 23 13 12 2 4
Ciphertext S X V R G D S X Q E G X N M C E
Plaintext A T T A C K A T O N C E V I A N
Key X V G J E R I O Q W J P E K A F
Plaintext 0 19 19 0 2 10 0 19 14 13 2 4 21 8 0 13
Key 23 21 6 9 3 17 8 14 16 22 9 15 4 10 0 5
Sum 23 14 25 9 5 1 8 7 4 9 11 19 25 18 0 18
Ciphertext X O Z J F B I H E J L T Z U A U
Types of Encryption
Block cipher
Encrypts blocks of data, often 128 bits
Stream cipher
Operates on a continuous stream of data
Block Ciphers
Encrypt and decrypt a block of data at a time
Typically 128 bits
Typical uses for block ciphers
Files, e-mail messages, text communications, web
Well known encryption algorithms
DES, 3DES, AES, CAST, Twofish, Blowfish, Serpent
Stream Ciphers
Used to encrypt a continuous stream
of data, such as an audio or video transmission
A stream cipher is a substitution cipher that typically uses an
exclusive-or (XOR) operation that can be performed very quickly
by a computer.
Plaintext 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0
Key 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0
Ciphertext 1 0 1 1 1 0 1 0 0 0 1 0 0 1 1 0
Encryption: simple XOR with key
Ciphertext 1 0 1 1 1 0 1 0 0 0 1 0 0 1 1 0
Key 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0
Plaintext 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0
Secret Key
Secure Channel
Cleartext Cleartext
Message Ciphertext Message
Encrypt Decrypt
0954D-1
Recipient’s Recipient’s
Public Key Private Key
Cleartext Cleartext
Message Ciphertext Message
Encrypt Decrypt
Originator Recipient
Digital signatures
used to verify authenticity of origin
Originator’s Originator’s
Private Key Public Key
27
Using Symmetric and
Asymmetric Together
Key exchange Recipient’s Recipient’s
Public Key Private Key
using asymmetric Session Session
cryptography Key
Encrypt
Ciphertext
Decrypt
Key
Uses asymmetric
keys to distribute
bulk encryption
keys
Allows rapid Cleartext Cleartext
distribution of short- Message
Encrypt
Ciphertext
Decrypt
Message
term keys
Originator Recipient
28
Symmetric Cryptography
Data Encryption Standard (DES)
The Data Encryption Standard (DES) is a symmetric-key
block cipher published by the National Institute of
Standards and Technology (NIST).
In 1973, NIST published a request for proposals for a
national symmetric-key cryptosystem. A proposal from
IBM, a modification of a project called Lucifer, was
accepted as DES. DES was published in the Federal
Register in March 1975 as a draft of the Federal
Information Processing Standard (FIPS).
There has been considerable controversy over the
design, particularly in the choice of a 56-bit key.
DES Overview
6.39
6.5.1
Attack Methods
Brute-Force Attack
the most basic method of attack is brute force — trying every
possible key in turn.
Combining the weakness of short cipher key with the key
complement weakness, it is clear that DES can be broken using
255 encryptions.
Differential Cryptanalysis
In the broadest sense, it is the study of how differences in
an input can affect the resultant difference at the output.
To break the full 16 rounds, differential cryptanalysis requires
247 chosen plaintexts.
It has been revealed that the designers of DES already knew
about this type of attack and designed S-boxes and chose 16 as
the number of rounds to make DES specifically resistant to this
type of attack.
Attack Methods-II
Linear cryptanalysis
Linear cryptanalysis is newer than differential cryptanalysis.
Linear cryptanalysis tries to take advantage of high probability
occurrences of linear expressions involving plaintext bits,
"ciphertext" bits, and subkey bits.
Linear cryptanalysis is a known plaintext attack and uses a linear
approximation to describe the behavior of the block cipher. Given
sufficient pairs of plaintext and corresponding ciphertext, bits of
information about the key can be obtained and increased
amounts of data will usually give a higher probability of success.
DES is more vulnerable to linear cryptanalysis than to differential
cryptanalysis. S-boxes are not very resistant to linear
cryptanalysis.
It has been shown that DES can be broken using 2 43 pairs of
known plaintexts. However, from the practical point of view,
finding so many pairs is very unlikely.
DES- Current State
Currently DES is no longer certified for US federal
use.
The availability of faster hardware, and access to
large distributed systems meant that 56-bit DES keys
could be recovered by brute force searches in an
unreasonably short time (days or even hours).
DES should almost certainly not be used in any new
product, and should not be used in existing products
to protect information with a lifetime of more than a
few minutes.
Double DES
Double DES
52
AES
Rules:
Unclassified
Royalty-free
Worldwide
Public domain
Significantly More Efficient than 3DES
Symmetric Block Cipher
AES Timeline:
Public comment through April 1999
Candidate Conference, March 22-23, 1999, Rome
Finalists selected summer 1999
AES3 conference, April 13 -14, 2000, New York 53
AES
Algorithms were submitted, and five finalists
were selected.
Finalists for the AES standard are:
• MARS (IBM - USA)
• RC6 (RSA Labs - USA)
• Rijndael (Daemen and Rijmen - Belgium)
• SERPENT (Anderson, Biham, and Knudsen -
UK, Israel, Norway)
• TWOFISH (Schneier, Kelsey, et al. - USA)
AES
The finalists were subjected to open review by
the cryptographic community.
The entire process took over 3 years to
complete.
The Rijndael algorithm was declared by NIST
to be the eventual winner, and is now generally
referred to as AES.
http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf