0% found this document useful (0 votes)
2 views

Chapter 3 Modified

Uploaded by

aytenawoke11
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 3 Modified

Uploaded by

aytenawoke11
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Chapter 3

Introduction to
Cryptography
Outline
▪ What is Cryptography
▪ Applications of Cryptography
▪ Symmetric key Cryptography
Problem 1:Secure communication

Alice Eve Bob


M M

Secure communication over unsecure channel


▪ Secure channel :an adversary does not have the
ability to reorder, insert, or read.
▪ Unsecure channel : parties other than those for
which the information is intended can reorder,
delete, insert, or read.
Problem 2: Secure Storage

Secure storage on un-trusted hosts


▪ Secure storage one from which only authorized users
can have access (read) to its information.
▪ Un-trusted host (and storage) one which unauthorized
users can have access to with the intent to read, delete,
modify protected information.
What is Cryptography?
▪ Cryptography is the science and study of secret writing
(practice and study of hiding information)

▪ Encryption :is the process of converting data into


meaningless form.
▪ Decryption :the translation of encrypted data into
original text.
Crypto-analysis

▪ Crypto-analysis(from the Greek kryptós, "hidden",


and analýein, "to loosen" or "to untie")
▪ The study of methods for obtaining the meaning
of encrypted information without access to the se
cret key which is normally required to do so.
▪ Typically, this involves finding the secret key
Applications of Cryptography
▪ File encryption
▪ Files are stored in encrypted form on disk
▪ Only owner and other authorized users has the
secret key for decrypting the file
▪ Attacks on standard file protection:
▪ Boot computer with a new operating system CD
▪ Steal hard drive
▪ Encrypting communication:
▪ Alice and Bob communicate over the internet
• Communication between browser and web
server
• Remote shell connection
Cont…
▪ Digital right management : refers to hardware and soft
ware systems providing access control for digital content
(e.g., music and video files)
▪Encrypting music
▪ Software music players (e.g., iTunes) encrypt purchased songs
▪ Songs are stored encrypted on disk and decryption keys
stored within player which is shared with a limited numb
er of trusted devices
▪ E-cash
▪ Encryption is used in electronic money schemes to prot-
ect conventional transaction data like account numbers
and transaction amounts.
▪ Digital signatures can replace handwritten signatures or
a credit-card authorizations.
Cryptographic system
▪ Cryptographic systems are generically classified along three
independent dimensions.
1. Based on the type of operations used for transforming pl
aintext to ciphertext.
▪ Substitutions: changing the plaintext one piece at a
time.
▪ Transformations: encrypt plaintext by moving small
pieces of the message around.
2. Based on the he number of keys used for encryption an
d decryption
• Using a single key for encryption and decryption
o Called Symmetric/Conventional encryption
o The same key is used to encrypt and decrypt a m
essage
P = DK [EK (P) ]
Cont…
▪ A pair of keys are used for encryption and decryption
o Called Asymmetric/Public key encryption
o keys for encryption and decryption are different but form
a unique pair
o P = DKD [EKE (P) ]
o Only one of the keys need to be private while the other ca
n be public
3. Based on the way in which the plaintext is processed
▪ Stream cipher: processes the input elements continuous
ly, producing output one element at a time.
▪ Block cipher: processes the input one block of elements
at a time, producing an output block for each input bloc
k.
Cryptosystem

▪ Quintuple(E, D, M, K, C)
▪ M:set of plaintexts
▪ K:set of keys
▪ C:set of ciphertexts
▪ E:set of encryption functions
▪ e: MxK→ C
▪ D:set of decryption functions
▪ d: CxK →M
Symmetric /Conventional Encryption
▪ The only form of encryption prior to late 1970s
▪ Plaintext: The original message or data
▪ Encryption algorithm: Performs various substitutions and
transformations on the plaintext.
▪ Substitutions: changing the plaintext one piece at a
time.
▪ Transformations: encrypt plaintext by moving small
pieces of the message around.
▪ Secret key: Input to the encryption algorithm.
▪ Ciphertext: Scrambled message produced as output.
▪ Depends on the plaintext and the secret key
▪ Decryption algorithm: Encryption algorithm run in reverse.
▪ Uses ciphertext and the secret key to produce the origin
al plaintext
Cont…
Cont…
Caesar Cipher
Cont…
CAESAR Algorithm
Cont…
▪ Example
CAESAR’s Problem

▪ Key is too short, can be found by exhaustive search.


• Brute force attack
▪ Monoalphabetic ciphers are easy to break because
they reflect the frequency data of the original alphabet
• Frequency analysis attack
▪ Countermeasure
▪ Polyalphabetic cipher-change the substitution patter
n (key) on a character basis
Playfair Cipher

▪ Best-known multiple-letter encryption


▪ Algorithm is based on the use of a 5 x 5 matrix of letters
▪ Constructed by using keyword
▪ Example
M O N A R

C H Y B D

E F G I/J K

L P Q S T

U V W X Z
Cont…
▪ The keyword is monarchy.

▪ The matrix is constructed by filling in the letters


of the keyword (minus duplicates) from left to rig
ht and from top to bottom, and then filling in th-
e remainder of the matrix with the remaining lett
ers in alphabetic order.

▪ The letters I and J count as one letter.


Encryption
▪ Plaintext is encrypted two letters at a time according to
the following rules:
1. Repeating plaintext letters that are in the same pair are
separated with a filler letter, such as x, so that balloon
would be treated as ba lx lo on.
2. Two plaintext letters that fall in the same row of the m
atrix are each replaced by the letter to the right, with t
he first element of the row circularly following the last.
▪ For example, AR is encrypted as RM.
3. Two plaintext letters that fall in the same column are e
ach replaced by the letter beneath, with the top eleme
nt of the column circularly following the last.
Cont…
▪ Example, MU is encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by t
he letter that lies in its own row and the column occupied
by the other plaintext letter.
▪ Example. HS becomes BP and ea becomes IM (or JM,
as the encipherer wishes).
M O N A R

C H Y B D

E F G I/J K

L P Q S T

U V W X Z
Cont…

▪ Great advancement over monoalphabetic cipher.

▪ There are about 26 x 26 = 676 diagrams.

▪ More difficult to identify individual diagrams and


relative frequencies of letters, so the playfair ciphe
r was unbreakable for a long.
Polyalphabetic Ciphers
Vigènere Cipher
Cont…
▪ Example:
Cryptanalysis of Vigenere

▪ On polyalphabetic ciphers we need

▪ Number of alphabets used

▪ Key for each one

▪ Cryptanalysis is harder since it is not only a matter-


s to check how the frequency has shifted
One-time Pad
▪ A Vigenère cipher with a random key at least as long as t
he message so that the key need not be repeated.

▪ Provably unbreakable

▪ Why?

Look at ciphertext DXQR. Equally likely to correspond to


plaintext DOIT (key AJIY) and to plaintext DONT (key AJDY) a
nd any other 4 letters.

▪ The key is to be used to encrypt and decrypt a single mes


sage, and then is discarded.
Cont..
▪ Warning: keys must be random, or you can attack

the cipher by trying to regenerate the key.

▪ Very large number of alphabets: one time pad (large


non-repeating keys on a pad)

▪ Each different, each used once and discarded.

▪ Problems: Printing, distribution, storage.


Transposition technique
▪ Performing some sort of permutation on the plaintext
letters.
▪ The simplest such cipher is the rail fence technique
▪ Plaintext is written down as a sequence of diagonals
and then read off as a sequence of rows.
▪ Example with k=2.
▪ Plaintext: “meet me after the toga party”
▪ Encryption using rail fence cipher
Cont…
▪ Ciphertext:“MEMATRHTGPRYETEFETEOAAT”

▪ How to decrypt it?

▪ A more complex scheme is to write the message

in a rectangle, row by row, and read 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.
Cont…
▪ For example: key=4312567
Cont…

▪ The transposition cipher can be made significantly


more secure by performing more than one stage of
transposition.
▪ Transposition of previous output (TTNAAPTMTSUOA
ODWCOIXKNLYPETZ) with the same key
Modern cryptography
▪ Feistel Cipher
▪ Simplified DES(S-DES)
Shannon theory
▪ Confusion(K C)
▪ Confusion makes the relation between the key and the cipherte
xt as complex as possible.
▪ Ideally, every letter in the key influences every letter of the cip
hertext block.
▪ Replacing every letter with the one next to it on the typewri
ter keyboard is a simple example of confusion by substitutio
n.
▪ Good confusion can only be achieved when each character of t
he ciphertext depends on several parts of the key, and this de
pendence appears to be random to the observer.
▪ Ciphers that do not offer much confusion (such as Vigenère cip
her) are vulnerable to frequency analysis
Cont..
Diffusion (M C)
▪ A fixed transformation can show good encryption at the
first iterations but it can fail in the long run.
▪ Diffusion refers to the property that the statistics structu
re of the plaintext is dissipated into long range statistics
of the ciphertext.
▪ In contrast to confusion, diffusion spreads the influence
of a single plaintext letter over many ciphertext letters.
▪ In terms of the frequency statistics of letters, digrams, et
c in the plaintext, diffusion randomly spreads them acro
ss several characters in the ciphertext.
▪ This means that much more ciphertexts are needed to
do a meaningful statistical attack on the cipher.
Cont…
Unconditional secure Systems
▪ can not be broken even if all possible keys could
be tried within short time

▪ are systems where the security of the cryptograph


ic scheme does not depend on the computational

power or resources of the adversary

▪ even if the adversary has unlimited computational

power, they cannot break the encryption.


Cont…
▪ The key properties of unconditionally secure systems
▪ The encryption and decryption process does not depen
d on the computational power of the adversary.

▪ The ciphertext does not provide any information about

the plaintext, even with unlimited computational resources.

▪ The key used for encryption must be as long as the

message and used only once (hence the name "One-Time


Pad").
Modern symmetric key cryptography
Product Cipher
SP-Network
Stream Ciphers and Block Ciphers

▪ Stream cipher is one that encrypts a digital data


stream one bit or one byte at a time.
E.g. Vigenère cipher and the Vernam cipher.
▪ Block cipher is one in which a block of plaintext i
s treated as a whole and used to produce a ciphe
rtext block of equal length.
▪Typically, a block size of 64 or 128 bits is used.
▪E.g. Feistel cipher and DES
Cont…
Block Cipher
▪ A block cipher operates on a block of n bits and it
produces a ciphertext block of n bits.
▪ There are 2n possible different plaintext/ciphertext
blocks.
▪ The encryption must be reversible. i.e. decryption to be
possible each plaintext must produce a unique ciphertex
-t block. (one-to-one correspondence)
▪ Such a transformation is called reversible, or nonsingular.
▪ The following examples illustrate nonsingular and singul
ar transformations for n=2.
Reversible vs. Irreversible Mapping

Reversible Mapping Irreversible Mapping


Plaintext Ciphertext Plaintext Ciphertext
00 11 00 11
01 10 01 10
10 00 10 01
11 01 11 01
The Feistel Cipher
▪ Horst Feistel devised the feistel cipher
▪ based on concept of invertible product cipher
▪ A practical application of a proposal by Claude Shann
on to develop a product cipher that alternates conf
usion and diffusion .
▪ Execution of two or more simple ciphers in sequence
in a way that the final result or product is cryptograp
hically stronger than any of the component ciphers.
▪ Virtually all conventional block encryption algorithms
including data encryption standard (DES) are based o
n Feistel Cipher Structure.
Cont…
▪ The inputs to the encryption algorithms are a plaintex
t block of length 2w bits and a key K.
▪ The plaintext block is divided into two halves, Lo and
Ro.
▪ The two halves of the data pass through n rounds of
processing which:
• perform a substitution on left data half
• based on round function of right half & sub key
• then have permutation: swapping halves
• and then combine to produce the ciphertext block.
▪ Implements Shannon’s substitution-permutation netw
ork concept
Classical Feistel Network
Cont…
Cont…
Cont…
▪ Each round i has as inputs Li-1 and Ri-1, derived from
the previous round, as well as a subkey ki, derived from
overall K.
▪ In general the subkeys ki are different from K and
from each other.
▪ All rounds have the same structure.
▪ With the exception of the initial and final permutation
s, DES has the exact structure of a Feistel cipher.
Cont…
▪ A substitution is performed on the left half of the

data.

▪ Round function F is applied to the right half of the


data and then taking the exclusive-OR of the output
of that function and the left half of the data.

▪ Transpositions performed by swapping the two halves


.
Feistel Decryption Algorithm

▪ Use the same algorithm with reversed keys.


▪Uses ciphertext as input
▪Uses subkeys ki in reverse order
▪ Uses kn in the first round.
▪ Kn-1 in the second round, and so on until k1 is us
ed in the last round.
Feistel Encryption and Decryption
Symmetric algorithms---Reading
▪ AES (Advanced Encryption Standard)
▪ DES (Data Encryption Standard)
▪ IDEA (International Data Encryption Algorithm)
▪ Blowfish (Drop-in replacement for DES or IDEA)
▪ RC4 (Rivest Cipher 4)
▪ RC5 (Rivest Cipher 5)
▪ RC6 (Rivest Cipher 6)
The end!
Any Question ?

You might also like