data security and encryption (cse348) 1. revision lectures 1-15 2
TRANSCRIPT
Data Security and Encryption
(CSE348)
1
Revision
Lectures 1-15
2
Course Outline
Part One: Symmetric Ciphers: Provides a survey of symmetric encryption, including classical and modern algorithms. The emphasis is on the two most important algorithms,the Data Encryption Standard (DES) and the Advanced Encryption Standard (AES).This part also covers the most important stream encryptionalgorithm,RC4,and the important topic of pseudorandom number generation.
3
Course Outline
Part Two: Asymmetric Ciphers: Provides a survey of public-key algorithms,including RSA (Rivest-Shamir-Adelman) and elliptic curve.
4
Course Outline
Part Three: Cryptographic Data Integrity Algorithms:Begins with a survey of cryptographichash functions. This part then covers two approaches to data integrity that rely on cryptographic hash functions: message authentication codes and digital signatures.
5
Course Outline
Part Four: Mutual Trust: Covers key management and key distribution topics and then covers user authentication techniques.
6
Course Outline
Part Five: Network Security and Internet Security: Examines the use of cryptographicalgorithms and security protocols to provide security over networks and the Internet. Topics covered include transport-level security, wireless network security, e-mail security, and IP security.
7
Course Outline
Part Six: System Security: Deals with security facilities designed to protect acomputer system from security threats, including intruders, viruses, and worms. This part also looks at firewall technology.
8
Course Outline
Part Seven: Legal and Ethical Issues: Deals with the legal and ethical issues relatedto computer and network security.
9
Computer Security
• Protection afforded to an automated information system in order to attain the applicable objectives of preserving the integrity, availability and confidentiality of information system resources (includes hardware, software, firmware, information/data, and telecommunications)
10
Key Security Concepts
11
CIA Triad
12
• These three concepts form what is often referred to as the CIA triad Figure above.
• The three concepts embody the fundamental security objectives for both data and for information and computing services.
• FIPS PUB 199 provides a useful characterization of these three objectives in terms of requirements and the definition of a loss of security in each category.
CIA Triad
13
• Confidentiality (covers both data confidentiality and privacy):
• Preserving authorized restrictions on information access and disclosure, including means for protecting personal privacy and proprietary information.
• A loss of confidentiality is the unauthorized disclosure of information.
CIA Triad
14
• Integrity (covers both data and system integrity):
• Guarding against improper information modification or destruction, and includes ensuring information non-repudiation and authenticity
• A loss of integrity is the unauthorized modification or destruction of information.
CIA Triad
15
• Availability: Ensuring timely and reliable access to and use of information. A loss of availability is the disruption of access to or use of information or an information system
• Although the use of the CIA triad to define security objectives is well established, some in the security field feel that additional concepts are needed to present a complete picture.
• Two of the most commonly mentioned are:
CIA Triad
16
• Authenticity: The property of being genuine and being able to be verified and trusted; confidence in the validity of a transmission, a message, or message originator
CIA Triad
17
• Accountability: The security goal that generates the requirement for actions of an entity to be traced uniquely to that entity
Computer Security Challenges1. not simple2. must consider potential attacks3. procedures used counter-intuitive4. involve algorithms and secret info5. must decide where to deploy mechanisms6. battle of wits between attacker / admin7. not perceived on benefit until fails8. requires regular monitoring9. too often an after-thought10. regarded as impediment to using system
18
Aspects of Security
• consider 3 aspects of information security:– security attack– security mechanism– security service
• note terms– threat – a potential for violation of security– attack – an assault on system security, a deliberate
attempt to evade security services
19
Passive Attacks
20
Active Attacks
21
Symmetric Encryption
• Conventional / private-key / single-key• sender and recipient share a common key• all classical encryption algorithms are private-
key• was only type prior to invention of public-key
in 1970’s• and by far most widely used
22
Some Basic Terminology• plaintext - original message • ciphertext - coded message • cipher - algorithm for transforming plaintext to ciphertext • key - info used in cipher known only to sender/receiver • encipher (encrypt) - converting plaintext to ciphertext • decipher (decrypt) - recovering ciphertext from plaintext• cryptography - study of encryption principles/methods• cryptanalysis (codebreaking) - study of principles/ methods
of deciphering ciphertext without knowing key• cryptology - field of both cryptography and cryptanalysis
23
Symmetric Cipher Model
24
Symmetric Cipher ModelIngredients of the symmetric cipher model• plaintext - original message• encryption algorithm – performs
substitutions/transformations on plaintext• secret key – control exact
substitutions/transformations used in encryption algorithm
• ciphertext - scrambled message• decryption algorithm – inverse of encryption
algorithm
25
Cryptanalysis
• objective to recover key not just message• general approaches:
– cryptanalytic attack– brute-force attack
• if either succeed all key use compromised
26
Cryptanalytic Attacks ciphertext only
only know algorithm & ciphertext, is statistical, know or can identify plaintext
known plaintext know/suspect plaintext & ciphertext
chosen plaintext select plaintext and obtain ciphertext
chosen ciphertext select ciphertext and obtain plaintext
chosen text select plaintext or ciphertext to en/decrypt
27
Brute Force Search• Brute-force attack involves trying every possible
key until an intelligible translation of the ciphertext into plaintext is obtained
• On average, half of all possible keys must be tried to achieve success
• Different time is required to conduct a brute-force attack, for various common key sizes
28
Brute Force Search
• Data Encryption Standard(DES) is 56• Advanced Encryption Standard (AES) is 128• Triple-DES is 168
29
Brute Force Search
• always possible to simply try every key • most basic attack, proportional to key size • assume either know / recognise plaintext
Key Size (bits) Number of Alternative Keys
Time required at 1 decryption/µs
Time required at 106 decryptions/µs
32 232 = 4.3 109 231 µs = 35.8 minutes 2.15 milliseconds
56 256 = 7.2 1016 255 µs = 1142 years 10.01 hours
128 2128 = 3.4 1038 2127 µs = 5.4 1024 years 5.4 1018 years
168 2168 = 3.7 1050 2167 µs = 5.9 1036 years 5.9 1030 years
26 characters (permutation)
26! = 4 1026 2 1026 µs = 6.4 1012 years 6.4 106 years
30
Classical Substitution Ciphers
• where letters of plaintext are replaced by other letters or by numbers or symbols
• or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with ciphertext bit patterns
31
Caesar Cipher
• Substitution ciphers form the first of the fundamental building blocks
• Core idea is to replace one basic unit (letter/byte) with another
• Whilst the early Greeks described several substitution ciphers
32
Classical Cipher Techniques
• have considered:– monoalphabetic substitution ciphers
• cryptanalysis using letter frequencies
– Playfair cipher• Cryptanalysis of Playfair Cipher
– Polyalphabetic Ciphers– Vigenère Cipher
33
Monoalphabetic Cipher
• rather than just shifting the alphabet • could shuffle (jumble) the letters arbitrarily • each plaintext letter maps to a different random
ciphertext letter • hence key is 26 letters long
Plain: abcdefghijklmnopqrstuvwxyzCipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplacelettersCiphertext: WIRFRWAJUHYFTSDVFSFUUFYA
34
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
the Playfair Cipher is an example invented by Charles Wheatstone in 1854, but
named after his friend Baron Playfair
35
Polyalphabetic Ciphers
polyalphabetic substitution ciphers improve security using multiple cipher alphabets make cryptanalysis harder with more alphabets to
guess and flatter frequency distribution use a key to select which alphabet is used for each
letter of the message use each alphabet in turn repeat from start after end of key is reached
36
Vigenère Cipher
• simplest polyalphabetic substitution cipher• effectively multiple caesar ciphers • 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• decryption simply works in reverse
37
Other Classical Cipher Techniques
• have considered:– polyalphabetic ciphers– transposition ciphers– product ciphers and rotor machines– stenography
38
Kasiski Method
• For some centuries the Vigenère cipher was le chiffre indéchiffrable (the unbreakable cipher)
• As a result of a challenge, it was broken by Charles Babbage (the inventor of the computer) in 1854
• but kept secret (possibly because of the Crimean War - not the first time governments have kept advances to themselves!)
• The method was independently reinvented by a Prussian, Friedrich Kasiski, who published the attack now named after him in 1863.
39
Kasiski Method
• However lack of major advances meant that various polyalphabetic substitution ciphers were used into the 20C
• One very famous incident was the breaking of the Zimmermann telegram in WW1 which resulted in the USA entering the war
• If two identical sequences of plaintext letters occur at a distance that is an integer multiple of the keyword length
• They will generate identical ciphertext sequences 40
Transposition Ciphers
consider classical transposition or permutation ciphers
these hide the message by rearranging the letter order
without altering the actual letters used
can recognise these since have the same frequency distribution as the original text
41
Rotor Machines
• Before modern ciphers, rotor machines were most common complex ciphers in use
• widely used in WW2– German Enigma, Allied Hagelin, Japanese Purple
• implemented a very complex, varying substitution cipher
• used a series of cylinders, each giving one substitution, which rotated and changed after each letter was encrypted
• with 3 cylinders have 263=17576 alphabets
42
Steganography
• Steganography is an alternative to encryption which hides the very existence of a message by some means
• There are a large range of techniques for doing this
• Steganography has a number of drawbacks when compared to encryption
• It requires a lot of overhead to hide a relatively few bits of information
43
Steganography
• Also, once the system is discovered, it becomes virtually worthless
• although a message can be first encrypted and then hidden using steganography
• The advantage of steganography is that it can be employed by parties who have something to lose
• should the fact of their secret communication (not necessarily the content) be discovered
44
Modern Block Ciphers
now look at modern block ciphers one of the most widely used types of cryptographic
algorithms provide secrecy /authentication services focus on DES (Data Encryption Standard) We will see block cipher design principles
45
Block vs Stream Ciphers• block ciphers process messages in blocks, each of
which is then en/decrypted • like a substitution on very big characters
– 64-bits or more
• stream ciphers process messages a bit or byte at a time when en/decrypting
• many current ciphers are block ciphers– better analysed– broader range of applications
46
Block vs Stream Ciphers
A block cipher is one in which a block of plaintext is treated as a whole and used to produce a ciphertext block of equal length
Typically, a block size of 64 or 128 bits is used
As with a stream cipher, the two users share a symmetric encryption key
47
Block Cipher Principles Most symmetric block ciphers are based on a Feistel
Cipher Structure needed since must be able to decrypt ciphertext to
recover messages efficiently block ciphers look like an extremely large substitution would need table of 264 entries for a 64-bit block instead create from smaller building blocks using idea of a product cipher
48
Confusion and Diffusion• The terms diffusion and confusion were introduced
by Claude Shannon
• To capture the two basic building blocks for any cryptographic system
• Shannon's concern was to thwart cryptanalysis based on statistical analysis
• Every block cipher involves a transformation of a block of plaintext into a block of ciphertext
49
Confusion and Diffusion
• diffusion – dissipates statistical structure of plaintext over bulk of ciphertext
• confusion – makes relationship between ciphertext and key as complex as possible
50
Feistel Cipher Structure
51
Feistel Cipher Structure
• Horst Feistel devised the feistel cipher– based on concept of invertible product cipher
• partitions input block into two halves– process through multiple rounds which– perform a substitution on left data half– based on round function of right half & subkey– then have permutation swapping halves
• implements Shannon’s S-P net concept
52
Feistel Cipher Design Elements block size key size number of rounds subkey generation algorithm round function fast software en/decryption ease of analysis
53
54
Data Encryption Standard (DES)– Data Encryption Standard (DES)– DES Encryption– Initial Permutation IP– DES Round Structure– Substitution Boxes S– DES Key Schedule– DES Example– Avalanche in DES
55
DES Encryption Overview
56
DES Encryption Overview• The overall scheme for DES encryption is
illustrated in Stallings Figure• which takes as input 64-bits of data and of key• The left side shows the basic process for
enciphering a 64-bit data block which consists of: • an initial permutation (IP) which shuffles the
64-bit input block• 16 rounds of a complex key dependent round
function involving substitutions & permutations
• a final permutation, being the inverse of IP
57
DES Encryption Overview• The right side shows the handling of the 56-bit
key and consists of:
• an initial permutation of the key (PC1) which selects 56-bits out of the 64-bits input, in two 28-bit halves
• 16 stages to generate the 48-bit subkeys using a left circular shift and a permutation of the two 28-bit halves
Advanced Encryption Standard (AES)
– the AES selection process– the details of Rijndael – the AES cipher– looked at the steps in each round– Four AES stages are discussed
• Substitute bytes• Shift Rows• MixColumns• AddRoundKey
– the key expansion– implementation aspects
58
The AES Cipher - Rijndael
• designed by Rijmen-Daemen in Belgium • has 128/192/256 bit keys, 128 bit data • an iterative rather than feistel cipher
– processes data as block of 4 columns of 4 bytes– operates on entire data block in every round
• designed to be:– resistant against known attacks– speed and code compactness on many CPUs– design simplicity
59
AES Encryption
Process
60
AES Structure The input to the AES encryption and decryption
algorithms is a single 128-bit block
depicted in FIPS PUB 197, as a square matrix of bytes
This block is copied into the State array
which is modified at each stage of encryption or decryption
61
AES Structure After the final stage, State is copied to an output
The key is expanded into 44/52/60 lots of 32-bit words
with 4 used in each round
The ordering of bytes within a matrix is by column
62
AES Structure So, for example, the first four bytes of a 128-bit
plaintext input to the encryption cipher occupy the first column of the in matrix
the second four bytes occupy the second column, and so on
Similarly, the first four bytes of the expanded key, which form a word, occupy the first column of the w matrix
63
AES Structure The data computation then consists of an “add round
key” step, then 9/11/13 rounds with all 4 steps
and a final 10th /12th /14th step of byte subs + mix cols + add round key
This can be viewed as alternating XOR key & scramble data bytes operations
All of the steps are easily reversed, and can be efficiently implemented using XOR’s & table lookups
64
AES Structure data block of 4 columns of 4 bytes is state key is expanded to array of words has 9/11/13 rounds in which state undergoes:
byte substitution (1 S-box used on every byte) shift rows (permute bytes between groups/columns) mix columns (subs using matrix multiply of groups) add round key (XOR state with key material)view as alternating XOR key & scramble data bytes
initial XOR key material & incomplete last round with fast XOR & table lookup implementation
65
AES
Stru
ctur
e
66Figure 5.3 AES Encryption and Decryption
AES Structure Stallings Figure 5.3 shows the structure of AES in
more detail The cipher consists of N rounds, where the
number of rounds depends on the key length: 10 rounds for a 16-byte key; 12 rounds for a 24-byte key; and 14 rounds for a 32-byte key
67
AES Structure The first N – 1 rounds consist of four distinct
transformation functions: SubBytes, ShiftRows, MixColumns, AddRoundKey,
which are described subsequently
68
AES Structure The final round contains only 3 transformation
There is a initial single transformation (AddRoundKey) before the first round
Which can be considered Round 0
Each transformation takes one or more 4 x 4 matrices as input and produces a 4 x 4 matrix as output
69
AES Structure Figure 5.1 shows that the output of each round is
a 4 x 4 matrix
with the output of the final round being the ciphertext
Also, the key expansion function generates N + 1 round keys
each of which is a distinct 4 x 4 matrix
Each round key serve as one of the inputs to the AddRoundKey transformation in each round
70
Some Comments on AES1. an iterative rather than feistel cipher2. key expanded into array of 32-bit words
1. four words form round key in each round3. 4 different stages are used as shown4. has a simple structure5. only AddRoundKey uses key6. AddRoundKey a form of Vernam cipher7. each stage is easily reversible8. decryption uses keys in reverse order9. decryption does recover plaintext10. final round has only 3 stages
71
Four Stages of AES• Four different stages are used, one of permutation
and three of substitution:
– Substitute bytes: Uses an S-box to perform a byte-by-byte substitution of the block
– ShiftRows: A simple permutation– MixColumns: A substitution that makes use of
arithmetic over– AddRoundKey: A simple bitwise XOR of the
current block with a portion of the expanded key
72
Number Theory
• have considered:– Number Theory– divisibility & GCD– modular arithmetic with integers– Euclid’s algorithm for GCD & Inverse– Group– Ring– Field– finite fields GF(p)– polynomial arithmetic in general and in GF(2n)
73
Multiple Encryption & DES
Given the potential vulnerability of DES to a brute-force attack
There has been considerable interest in finding an alternative
One approach is to design a completely new algorithm, of which AES is a prime example
74
Multiple Encryption & DES
Another alternative, which would preserve the existing investment in software and equipment
To use multiple encryption with DES and multiple keys
Widely accepted triple DES (3DES) approach is examined
75
Multiple Encryption & DES
clear a replacement for DES was needed theoretical attacks that can break itdemonstrated exhaustive key search attacks
AES is a new cipher alternative
Prior to this alternative was to use multiple encryption with DES implementations
Triple-DES is the chosen form
76
Why not Double-DES? The simplest form of multiple encryption has two
encryption stages and two keys - Double-DES
Have concern that there might be a single key that is equivalent to using 2 keys as above
Not likely but only finally proved as impossible in 1992
More seriously have the “meet-in-the-middle” attack, first described by Diffie in 1977
77
Why not Double-DES? It is a known plaintext attack i.e. have known pair
(P,C)
Attempts to find by trial-and-error a value X in the “middle” of the double-DES encryption of this pair
Chances of this are much better at O(2^56) than exhaustive search at O(2^112)
78
Why not Double-DES?AES is a new cipher alternativecould use 2 DES encrypts on each block
C = EK2(EK1(P))concern at time of reduction to single stage“meet-in-the-middle” attack
works whenever use a cipher twice since X = EK1(P) = DK2(C) attack by encrypting P with all keys and store then decrypt C with keys and match X value can show takes O(2^56) steps
79
Triple-DES with Two-Keys
Triple-DES with two keys is a popular alternative to single-DES
But suffers from being 3 times slower to run
The use of encryption & decryption stages are equivalent
But the chosen structure allows for compatibility with single-DES implementations
80
Triple-DES with Two-Keys
3DES with two keys is a relatively popular alternative to DES
Has been adopted for use in the key management standards ANS X9.17 and ISO 8732
Currently, there are no practical cryptanalytic attacks on 3DES
Coppersmith notes that the cost of a brute-force key search on 3DES is on the order of 2^112 (=5*10^33)
81
Triple-DES with Two-Keys
Estimates that the cost of differential cryptanalysis suffers an exponential growth
compared to single DES, exceeding 10^52
Several proposed attacks on 3DES that, although not currently practical
Give a flavor for the types of attacks that have been considered and that could form the basis for more successful future attacks
82
Triple-DES with Two-Keys Hence must use 3 encryptions
would seem to need 3 distinct keys But can use 2 keys with E-D-E sequence
C = EK1(DK2(EK1(P))) n.b. encrypt & decrypt equivalent in security if K1=K2 then can work with single DES
Standardized in ANSI X9.17 & ISO8732 No current known practical attacks
several proposed impractical attacks might become basis of future attacks
83
Triple-DES with Three-Keys
Attacks currently known appear impractical
Anyone using two-key 3DES may feel some concern
Thus, many researchers now feel that three-key 3DES is the preferred alternative
Three-key 3DES has effective key length of 168 bits
A number of Internet-based applications have adopted three-key 3DES, including PGP and S/MIME
84
Modes of Operation DES (or any block cipher) forms a basic building block
which en/decrypts a fixed sized block of data
However to use these in practice, we usually need to handle arbitrary amounts of data
which may be available in advance (in which case a block mode is appropriate)
85
Modes of Operation May only be available a bit/byte at a time (in which case
a stream mode is used)
To apply a block cipher in a variety of applications, five "modes of operation" have been defined by NIST (SP 800-38A)
In essence, a mode of operation is a technique for enhancing the effect of a cryptographic algorithm
or adapting the algorithm for an application86
Modes of Operation Such as applying a block cipher to a sequence of data
blocks or a data stream
Five modes are intended to cover a wide variety of applications of encryption for which a block cipher could be used
These modes are intended for use with any symmetric block cipher, including triple DES and AES
87
Modes of Operation block ciphers encrypt fixed size blocks
e.g., DES encrypts 64-bit blocks need some way to en/decrypt arbitrary amounts of data
in practice NIST SP 800-38A defines 5 modes have block and stream modes to cover a wide variety of applications can be used with any block cipher
88
Block Cipher Operation
Multiple Encryption & Triple-DES Modes of Operation
ECB, CBC, CFB, OFB, CTR, XTS-AES
89
Random Numbers Random numbers play an important role in the use
of encryption for various network security applications
Brief overview of the use of random numbers in cryptography and network security is provided
Focus on the principles of pseudorandom number generation
Getting good random numbers is important, but difficult
90
Random Numbers You don't want someone guessing the key you're
using to protect your communications
Because your "random numbers" weren't (as happened in an early release of Netscape SSL)
Traditionally, the concern in the generation of a sequence of allegedly random numbers has been
91
Random Numbers That the sequence of numbers be random in some
well-defined statistical sense with uniform distribution & independent
Applications such as reciprocal authentication, session key generation, and stream ciphers
The requirement is not just that the sequence of numbers be statistically random
But that the successive members of the sequence are unpredictable 92
Random Numbers With "true" random sequences
Each number is statistically independent of other numbers in the sequence and unpredictable
True random numbers are seldom used
Rather, sequences of numbers that appear to be random are generated by some algorithm
93
Random Numbers Many uses of random numbers in cryptography
nonces in authentication protocols to prevent replay session keys public key generation keystream for a one-time pad
In all cases its critical that these values be statistically random, uniform distribution,
independent unpredictability of future values from previous values
True random numbers provide this Care needed with generated random numbers
94
Pseudorandom Number Generators (PRNGs)
Often use deterministic algorithmic techniques to create “random numbers” although are not truly random can pass many tests of “randomness”
Known as “pseudorandom numbers” Created by “Pseudorandom Number Generators
(PRNGs)”
95
Random & Pseudorandom Number Generators
A true random number generator (TRNG) contrasts with two forms of pseudorandom number generators
A TRNG takes as input a source that is effectively random; the source is often referred to as an entropy source
In contrast, a PRNG takes as input a fixed value, called the seed, and produces a sequence of output bits using a deterministic algorithm
96
Random & Pseudorandom Number Generators
There is some feedback path by which some of the results of the algorithm are fed back as input as additional output bits are produced
The output bit stream is determined solely by the input value or values
So that an adversary who knows the algorithm and the seed can reproduce the entire bit stream
97
Random & Pseudorandom Number Generators
Two different forms of PRNGs, based on application;
Pseudorandom number generator
An algorithm that is used to produce an open-ended sequence of bits is referred to as a PRNG
A common application for an open-ended sequence of bits is as input to a symmetric stream cipher
98
Random & Pseudorandom Number Generators
Pseudorandom function (PRF)
A PRF is used to produced a pseudorandom string of bits of some fixed length
Examples are the symmetric encryption keys and nonces
The PRF takes as input a seed plus some context specific values, such as a user ID or an application ID
99
Stream ciphersRandom Number Generation
Pseudorandom number generation True random numbers Stream ciphers RC4
100
Private-Key Cryptography The development of public-key cryptography is the
greatest
Perhaps the only true revolution in the entire history of cryptography
From its earliest beginnings to modern times, virtually all cryptographic systems have been based on
the elementary tools of substitution and permutation
101
Private-Key Cryptography Can be classed as private/secret/single key
(symmetric) systems
All classical, and modern block and stream ciphers are of this form
102
Private-Key Cryptography Traditional private/secret/single key cryptography
uses one key
Shared by both sender and receiver
If this key is disclosed communications are compromised
Also is symmetric, parties are equal
Hence does not protect sender from receiver forging a message & claiming is sent by sender
103
Public-Key Cryptography
• Probably most significant advance in the 3000 year history of cryptography
• Uses two keys – a public & a private key
• Asymmetric since parties are not equal
• Uses clever application of number theoretic concepts to function
• Complements rather than replaces private key crypto
104
Public-Key Cryptography
• Radically different public key systems, in which two keys are used
• Public-key cryptography provides a radical departure from all that has gone before
• The development of public-key cryptography is the greatest and perhaps the only true revolution in the entire history of cryptography
• It is asymmetric, involving the use of two separate keys, in contrast to symmetric encryption
105
Public-Key Cryptography• symmetric encryption uses only one key
• Anyone knowing the public key can encrypt messages or verify signatures
• But cannot decrypt messages or create signatures, counter-intuitive though this may seem
• The use of two keys has profound consequences in the areas of confidentiality– key distribution– Authentication
106
Public-Key Cryptography• It works by the clever use of number theory
problems
• That are easy one way but hard the other
• Public key schemes are neither more nor less secure than private key
• Security depends on the key size for both
107
Public-Key Cryptography• Nor do they replace private key schemes (they are
too slow to do so), rather they complement them
• Both also have issues with key distribution, requiring the use of some suitable protocol
108
Why Public-Key Cryptography?
• Developed to address two key issues:– key distribution – how to have secure
communications in general without having to trust a KDC with your key
– digital signatures – how to verify a message comes intact from the claimed sender
• Public invention due to Whitfield Diffie & Martin Hellman at Stanford Uni in 1976– known earlier in classified community
109
Public-Key Cryptography
• Asymmetric algorithms rely on one key for encryption
• And a different but related key for decryption
• These algorithms have the following important characteristic
• It is computationally infeasible to determine the decryption key
110
Public-Key Cryptography
• Given only knowledge of the cryptographic algorithm and the encryption key
• In addition, some algorithms, such as RSA, also exhibit the following characteristic
• Either of the two related keys can be used for encryption, with the other used for decryption
111
Public-Key Cryptography
• Anyone knowing the public key can encrypt messages or verify signatures
• But cannot decrypt messages or create signatures, thanks to some clever use of number theory
112
Public-Key Cryptography• Public-key/two-key/asymmetric cryptography involves
the use of two keys: – a public-key, which may be known by anybody, and can be
used to encrypt messages, and verify signatures – a related private-key, known only to the recipient, used to
decrypt messages, and sign (create) signatures• Infeasible to determine private key from public• is asymmetric because
– those who encrypt messages or verify signatures cannot decrypt messages or create signatures
113
Public-Key Cryptography
114
Public-Key Cryptography• Stallings Figure 9.1a “Public-Key Cryptography”,
• Shows that a public-key encryption scheme has six ingredients:
• Plaintext: the readable message /data fed into the algorithm as input
• Encryption algorithm: performs various transformations on the plaintext
115
Public-Key Cryptography• Public and private keys: a pair of keys selected so
that if one is used for encryption, the other is used for decryption
• The exact transformations performed by the algorithm depend on the public or private key that is provided as input
116
Public-Key Cryptography• Ciphertext: the scrambled message produced as
output
• It depends on the plaintext and the key
• For a given message, two different keys will produce two different ciphertexts
117
Public-Key Cryptography• Decryption algorithm: accepts the ciphertext and
matching key
• And produces the original plaintext
118
Public-Key Cryptography• Consider the following analogy using padlocked
boxes
• Traditional schemes involve the sender putting a message in a box and locking it
• Sending that to the receiver
• And somehow securely also sending them the key to unlock the box
119
Public-Key Cryptography• The radical advance in public key schemes was to
turn this around
• The receiver sends an unlocked box (their public key) to the sender
• Who puts the message in the box and locks it
120
Public-Key Cryptography• Easy - and having locked it cannot get at the
message
• And sends the locked box to the receiver who can unlock it (also easy), having the (private) key
• An attacker would have to pick the lock on the box (hard)
121
Symmetric vs Public-Key
122
Revision
Lectures 1-15
123