SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
Presentation is based on the book
„Understanding Cryptography – A Textbook for
Students and Practitioners“
by Christof Paar and Jan Pelzl
www.crypto-textbook.com
Parts II and III– Introduction to Cryptography
These slides were prepared by Christof Paar, Jan Pelzl and Maksim Djackov
2/36 Understanding Cryptography by Christof Paar and Jan Pelzl
Some legal stuff: Terms of Use
• The slides can used free of charge. All copyrights for the slides remain with
Christof Paar and Jan Pelzl.
• The title of the accompanying book “Understanding Cryptography” by
Springer and the author’s names must remain on each slide.
• If the slides are modified, appropriate credits to the book authors and the
book title must remain within the slides.
• It is not permitted to reproduce parts or all of the slides in printed form
whatsoever without written consent by the authors.
3/36 Understanding Cryptography by Christof Paar and Jan Pelzl
 Further Reading and Information
Addition to Understanding Cryptography .
• A.Menezes, P. van Oorschot, S. Vanstone, Handbook of Applied Cryptography.
CRC Press, October 1996.
• H.v.Tilborg (ed.), Encyclopedia of Cryptography and Security, Springer, 2005
History of Cryptography (great bedtime reading)
• S. Singh, The Code Book: The Science of Secrecy from Ancient Egypt to
Quantum Cryptography, Anchor, 2000.
• D. Kahn, The Codebreakers: The Comprehensive History of Secret
Communication from Ancient Times to the Internet. 2nd edition, Scribner, 1996.
Software (excellent demonstration of many ancient and modern ciphers)
• Cryptool, http://www.cryptool.de
4/36 Understanding Cryptography by Christof Paar and Jan Pelzl
Part II
Content of this Chapter
• Random number generators (RNGs)
5/27 Understanding Cryptography by Christof Paar and Jan Pelzl
 Random number generators (RNGs)
RNG
Cryptographically
Secure RNG
Pseudorandom NGTrue RNG
6/27 Understanding Cryptography by Christof Paar and Jan Pelzl
 True Random Number Generators (TRNGs)
• Based on physical random processes: coin flipping, dice rolling, semiconductor
noise, radioactive decay, mouse movement, clock jitter of digital circuits
• Output stream si should have good statistical properties:
Pr(si = 0) = Pr(si = 1) = 50% (often achieved by post-processing)
• Output can neither be predicted nor be reproduced
Typically used for generation of keys, nonces (used only-once values) and for
many other purposes
7/27 Understanding Cryptography by Christof Paar and Jan Pelzl
 Pseudorandom Number Generator (PRNG)
• Generate sequences from initial seed value
• Typically, output stream has good statistical properties
• Output can be reproduced and can be predicted
Often computed in a recursive way:
),...,,( 11
0
tiiii sssfs
seeds
 

Example: rand() function in ANSI C:
31
1
0
2mod123451103515245
12345


 ii ss
s
Most PRNGs have bad cryptographic properties!
8/27 Understanding Cryptography by Christof Paar and Jan Pelzl
 Cryptographically Secure Pseudorandom Number
Generator (CSPRNG)
• Special PRNG with additional property:
• Output must be unpredictable
More precisely: Given n consecutive bits of output si , the following output bits sn+1
cannot be predicted (in polynomial time).
• Needed in cryptography, in particular for stream ciphers
• Remark: There are almost no other applications that need unpredictability,
whereas many, many (technical) systems need PRNGs.
9/27 Understanding Cryptography by Christof Paar and Jan Pelzl
 Cryptographically Secure Pseudorandom Number
Generator (CSPRNG) (taken from Wikipedia.org)
CSPRNG designs are divided into three classes:
1. Those based on cryptographic primitives such as ciphers and cryptographic
hashes
2. Those based upon mathematical problems thought to be hard
3. Special-purpose designs. The last often introduce additional entropy when
available and, strictly speaking, are not "pure" pseudorandom number
generators, as their output is not completely determined by their initial state.
This addition can prevent attacks even if the initial state is compromised.
Example: s(i+1) = SHA-1(s) is a PRNG or CSPRNG? What makes it different from
using one of the symmetric stream ciphers as a CSPRNG? Can we predict s(i+1)
when using SHA-1 and not knowing initial seed? Stream cipher?
10/27 Understanding Cryptography by Christof Paar and Jan Pelzl
11/36 Understanding Cryptography by Christof Paar and Jan Pelzl
Part III
12
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
13
Two properties of symmetric (secret-key) crypto-systems:
• The same secret key K is used for encryption and decryption
• Encryption and Decryption are very similar (or even identical) functions
 Symmetric Cryptography revisited
eK(x) dK(y)x
y
x
KK
Alice Bob
Understanding Cryptography by Christof Paar and Jan Pelzl
14
 Symmetric Cryptography: Analogy
Understanding Cryptography by Christof Paar and Jan Pelzl
K K
Safe with a strong lock, only Alice and Bob have a copy of the key
• Alice encrypts  locks message in the safe with her key
• Bob decrypts  uses his copy of the key to open the safe
• Symmetric algorithms, e.g., AES or 3DES, are very secure, fast & widespread but:
• Key distribution problem: The secret key must be transported securely
• Number of keys: In a network, each pair of users requires an individual key
 n users in the network require keys, each user stores (n-1) keys
• Alice or Bob can cheat each other, because they have identical keys.
Example: Alice can claim that she never ordered a TV on-line from Bob (he could
have fabricated her order). To prevent this: „non-repudiation“
15
 Symmetric Cryptography: Shortcomings
Example:
6 users (nodes)
keys (edges)
Understanding Cryptography by Christof Paar and Jan Pelzl
15
2
56


16
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
New Idea:
Use the „good old mailbox“ principle:
Everyone can drop a letter
But: Only the owner has the
correct key to open the box
17
 Idea behind Asymmetric Cryptography
Understanding Cryptography by Christof Paar and Jan Pelzl
1976: first publication of such an algorithm by Whitfield Diffie and Martin Hellman,and
also by Ralph Merkle.
18
 Asymmetric (Public-Key) Cryptography
Principle: “Split up” the key
K
Public Key (Kpub)
(Encrypt)
Secret Key (Kpr)
(Decrypt)
Understanding Cryptography by Christof Paar and Jan Pelzl
 During the key generation, a key pair Kpub and Kpr is computed
19
 Asymmetric Cryptography: Analogy
Understanding Cryptography by Christof Paar and Jan Pelzl
Safe with public lock and private lock:
• Alice deposits (encrypts) a message with the - not secret - public key Kpub
• Only Bob has the - secret - private key Kpr to retrieve (decrypt) the message
(Kpub) (Kpr)
20
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
21
 Basic Protocol for Public-Key Encryption
Alice Bob
(KpubB,KprB) = KKpubB
x
y=eKpubB
(x) y
x=dKprB
(y)
Understanding Cryptography by Christof Paar and Jan Pelzl
 Key Distribution Problem solved *
*) at least for now; public keys need to be authenticated, cf.Chptr. 13 of Understanding Cryptogr.
22
 Security Mechanisms of Public-Key Cryptography
Here are main mechanisms that can be realized with asymmetric cryptography:
• Key Distribution (e.g., Diffie-Hellman key exchange, RSA) without a pre-
shared secret (key)
• Nonrepudiation and Digital Signatures (e.g., RSA, DSA or ECDSA) to
provide message integrity
• Identification, using challenge-response protocols with digital signatures
• Encryption (e.g., RSA / Elgamal)
Disadvantage: Computationally very intensive
(1000 times slower than symmetric Algorithms!)
Understanding Cryptography by Christof Paar and Jan Pelzl
23
 Basic Key Transport Protocol 1/2
In practice: Hybrid systems, incorporating asymmetric and symmetric algorithms
1. Key exchange (for symmetric schemes) and digital signatures are performed
with (slow) asymmetric algorithms
2. Encryption of data is done using (fast) symmetric ciphers, e.g., block ciphers
or stream ciphers
Understanding Cryptography by Christof Paar and Jan Pelzl
 Basic Key Transport Protocol 2/2
Alice
24 Understanding Cryptography by Christof Paar and Jan Pelzl
Bob
y1 = eKpubB
(K) y1
K = dKprB
(y1)
Key Exchange
(asymmetric)
y2 = AESK (x) x = AES-1
K (y2)
y2
Data Encryption
(symmetric)
(KpubB,KprB) = K
KpubB
Choose random
symmetric key K
message x
Example: Hybrid protocol with AES as the symmetric cipher
 Key Transport Protocol Example
25 Understanding Cryptography by Christof Paar and Jan Pelzl
26
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
27
 How to build Public-Key Algorithms
Asymmetric schemes are based on a „one-way function“ f():
• Computing y = f(x) is computationally easy
• Computing x = f-1(y) is computationally infeasible
One way functions are based on mathematically hard problems.
Three main families:
• Factoring integers (RSA, ...):
Given a composite integer n, find its prime factors
(Multiply two primes: easy)
• Discrete Logarithm (Diffie-Hellman, Elgamal, DSA, …):
Given a, y and m, find x such that ax = y mod m
(Exponentiation ax : easy)
• Elliptic Curves (EC) (ECDH, ECDSA): Generalization of discrete logarithm
Note: The problems are considered mathematically hard, but no proof exists (so far).
Understanding Cryptography by Christof Paar and Jan Pelzl
28
 Key Lengths and Security Levels
Symmetric ECC RSA, DL Remark
64 Bit 128 Bit  700 Bit Only short term security
(a few hours or days)
80 Bit 160 Bit  1024 Bit Medium security
(except attacks from big
governmental institutions etc.)
128 Bit 256 Bit  3072 Bit Long term security
(without quantum computers)
• The exact complexity of RSA (factoring) and DL (Index-Calculus) is difficult to estimate
• The existence of quantum computers would probably be the end for ECC, RSA & DL
(at least 2-3 decades away, and some people doubt that QC will ever exist)
Understanding Cryptography by Christof Paar and Jan Pelzl
29
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
30 Understanding Cryptography by Christof Paar and Jan Pelzl
The RSA Cryptosystem
• Martin Hellman and Whitfield Diffie published their landmark public-
key paper in 1976
• Ronald Rivest, Adi Shamir and Leonard Adleman proposed the
asymmetric RSA cryptosystem in1977
• Until now, RSA is the most widely use asymmetric cryptosystem
although elliptic curve cryptography (ECC) becomes increasingly
popular
• RSA is mainly used for two applications
• Transport of (i.e., symmetric) keys (cf. Chptr 13 of Understanding
Cryptography)
• Digital signatures (cf. Chptr 10 of Understanding Cryptography)
31
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
• Proposed in 1976 by Whitfield Diffie and Martin Hellman
• Widely used, e.g. in Secure Shell (SSH), Transport Layer Security (TLS), and Internet
Protocol Security (IPSec)
• The Diffie–Hellman Key Exchange (DHKE) is a key exchange protocol and not used for
encryption
(For the purpose of encryption based on the DHKE, ElGamal can be used.)
 Diffie–Hellman Key Exchange: Overview
32 Understanding Cryptography by Christof Paar and Jan Pelzl
 Diffie–Hellman Key Exchange
•https://vimeo.com/67469421
33 Understanding Cryptography by Christof Paar and Jan Pelzl
34
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
35 Understanding Cryptography by Christof Paar and Jan Pelzl
 Motivation
• Alice orders a pink car from the car salesmen
Bob
• After seeing the pink car, Alice states that she
has never ordered it:
• How can Bob prove towards a judge that Alice
has ordered a pink car? (And that he did not
fabricate the order himself)
 Symmetric cryptography fails because both
Alice and Bob can be malicious
 Can be achieved with public-key cryptography
36 Understanding Cryptography by Christof Paar and Jan Pelzl
 Basic Principle of Digital Signatures
37 Understanding Cryptography by Christof Paar and Jan Pelzl
 Main idea
• For a given message x, a digital signature is
appended to the message (just like a conventional
signature).
• Only the person with the private key should be
able to generate the signature.
• The signature must change for every document.
The signature is realized as a function with the
message x and the private key as input.
The public key and the message x are the inputs
to the verification function.
38
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
39 Understanding Cryptography by Christof Paar and Jan Pelzl
Motivation
Problem:
Naive signing of long messages generates a signature of same length.
• Three Problems
• Computational overhead
• Message overhead
• Security limitations
• For more info see Section 11.1 in “Understanding Cryptography”.
Solution:
Instead of signing the whole message, sign only a digest (=hash)
Also secure, but much faster
Needed:
Hash Functions
40 Understanding Cryptography by Christof Paar and Jan Pelzl
Notes:
• x has fixed length
• z, y have fixed length
• z, x do not have equal length in general
• h(x) does not require a key.
• h(x) is public.
x
zi = h( xi || zi-1 )
sigkpr
z)
xi
z
y = sigkpr
(z)
 Digital Signature with a Hash Function
41 Understanding Cryptography by Christof Paar and Jan Pelzl
 Basic Protocol for Digital Signatures with a Hash Function:
Alice Bob
z = h(x)
s = sigKpr
(z)
(x, s)
z' = h(x)
verKpub
(s,z')=true/false
Kpub
42 Understanding Cryptography by Christof Paar and Jan Pelzl
 Principal input–output behavior of hash functions
43
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
44 Understanding Cryptography by Christof Paar and Jan Pelzl
 Hash Funktionen: Algorithms
• MD5 - family
• SHA-1: output - 160 Bit; input - 512 bit chunks of message x;
operations - bitwise AND, OR, XOR, complement und cyclic shifts.
• RIPE-MD 160: output - 160 Bit; input - 512 bit chunks of message x;
operations – like in SHA-1, but two in parallel and combinations of them
after each round.
Hash Algorithms
based on
block ciphers
Special Algorithms,
e.g. MD5 - family
45
Content of this Chapter
• Symmetric Cryptography Revisited
• Principles of Asymmetric Cryptography
• Practical Aspects of Public-Key Cryptography
• Important Public-Key Algorithms
• The RSA Cryptosystem
• Diffie–Hellman Key Exchange
• The Principle of Digital Signatures
• Why We Need Hash Functions
• Hash Algorithms
• Asymmetric Key Distribution
• Certificates
Understanding Cryptography by Christof Paar and Jan Pelzl
 Certificates
 In order to authenticate public keys (and thus, prevent the MIM attack) , all public keys
are digitally signed by a central trusted authority.
 Such a construction is called certificate
certificate = public key + ID(user) + digital signature over public key and ID
 In its most basic form, a certificate for the key kpub of user Alice is:
Cert(Alice) = (kpub, ID(Alice), sigKCA
(kpub,ID(Alice) )
 Certificates bind the identity of user to her public key
 The trusted authority that issues the certificate is referred to as certifying authority (CA)
 „Issuing certificates“ means in particular that the CA computes the signature sigKCA
(kpub)
using its (super secret!) private key kCA
 The party who receives a certificate, e.g., Bob, verifies Alice‘s public key using the public
key of the CA
46 Understanding Cryptography by Christof Paar and Jan Pelzl
• In the wild certificates contain much more information than
just a public key and a signature.
• X509 is a popular signature standard. The main fields of
such a certificate are shown to the right.
• Note that the „Signature“ at the bottom is computed over all
other fields in the certifcate (after hashing of all those
fields).
• It is important to note that there are two public-key
schemes involved in every certificate:
1. The public-key that actually is protected by the signature
(„Subject‘s Public Key“ on the right). This was the public
Diffie-Hellman key in the earlier examples.
2. The digital signature algorithm used by the CA to sign the
certificate data.
• For more information on certificates, see Section 13.3 of
Understanding Cryptography
 Certificates in the Real World
48 Understanding Cryptography by Christof Paar and Jan Pelzl
There are many additional problems when certificates are to be used in systems with a
large number of participants. The more pressing ones are:
1.Users communicate which other whose certificates are issued by different CAs
• This requires cross-certification of CAs, e.g.. CA1 certifies the public-key of
CA2. If Alice trusts „her“ CA1, cross-certification ensures that she also
trusts CA2. This is called a „chain of trust“ and it is said that „trust is
delegated“.
2.Certificate Revocation Lists (CRLs)
• Another real-world problem is that certificates must be revoced, e.g., if a
smart card with certificate is lost or if a user leaves an organization. For
this, CRLs must be sent out periodically (e.g., daily) which is a burden on
the bandwidth of the system.
More information on PKIs and CAs can be found in Section 13.3 of Understanding
Cryptography
 Remaining Issues with PKIs
49 Understanding Cryptography by Christof Paar and Jan Pelzl
50
 Lessons Learned
• Public-key algorithms have capabilities that symmetric ciphers don’t have, in
particular digital signature and key establishment functions.
• Public-key algorithms are computationally intensive (a nice way of saying that they are
slow), and hence are poorly suited for bulk data encryption.
• Only three families of public-key schemes are widely used. This is considerably fewer
than in the case of symmetric algorithms.
• RSA is the most widely used public-key cryptosystem
• RSA is mainly used for key transport and digital signatures
• The Diffie–Hellman protocol is a widely used method for key exchange. It is based on
cyclic groups.
• Digital signatures provide message integrity, message authentication and non-
repudiation.
• RSA is currently the most widely used digital signature algorithm.
• Hash functions are keyless. The two most important applications of hash functions are
their use in digital signatures and in message authentication codes such as HMAC.
Understanding Cryptography by Christof Paar and Jan Pelzl

Contenu connexe

Tendances

TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
EC-Council
 
Introductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information SecurityIntroductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information Security
Bikramjit Sarkar, Ph.D.
 

Tendances (20)

Cryptography - A Brief History
Cryptography - A Brief HistoryCryptography - A Brief History
Cryptography - A Brief History
 
Cryptography
CryptographyCryptography
Cryptography
 
cryptography
cryptographycryptography
cryptography
 
Cryptography cse,ru
Cryptography cse,ruCryptography cse,ru
Cryptography cse,ru
 
Cryptography
CryptographyCryptography
Cryptography
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
 
Introductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information SecurityIntroductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information Security
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cissp d5-cryptography v2012-mini coursev2
Cissp d5-cryptography v2012-mini coursev2Cissp d5-cryptography v2012-mini coursev2
Cissp d5-cryptography v2012-mini coursev2
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)
 
Cryptography
CryptographyCryptography
Cryptography
 
Pavan
PavanPavan
Pavan
 
Cryptography
Cryptography Cryptography
Cryptography
 
Information Security Cryptography ( L03- Old Cryptography Algorithms )
Information Security Cryptography ( L03- Old Cryptography Algorithms )Information Security Cryptography ( L03- Old Cryptography Algorithms )
Information Security Cryptography ( L03- Old Cryptography Algorithms )
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applications
 
Cryptography
CryptographyCryptography
Cryptography
 

Similaire à Introduction to Cryptography Parts II and III

Cryptography & network security
Cryptography & network securityCryptography & network security
Cryptography & network security
sathu30
 

Similaire à Introduction to Cryptography Parts II and III (20)

2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream Ciphers
 
3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives
 
Cryptography & network security
Cryptography & network securityCryptography & network security
Cryptography & network security
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 
Cryptography & Network Security.ppt-1.pdf
Cryptography & Network Security.ppt-1.pdfCryptography & Network Security.ppt-1.pdf
Cryptography & Network Security.ppt-1.pdf
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptx
 
Symmetric
SymmetricSymmetric
Symmetric
 
CNIT 141: 10. Digital Signatures
CNIT 141: 10. Digital SignaturesCNIT 141: 10. Digital Signatures
CNIT 141: 10. Digital Signatures
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
MAT255_Final_Paper_RSA_Encryption
MAT255_Final_Paper_RSA_EncryptionMAT255_Final_Paper_RSA_Encryption
MAT255_Final_Paper_RSA_Encryption
 
Ch03
Ch03Ch03
Ch03
 
CNIT 141: 11. Hash Functions
CNIT 141: 11. Hash FunctionsCNIT 141: 11. Hash Functions
CNIT 141: 11. Hash Functions
 
Symmetric Encryption Techniques
Symmetric Encryption Techniques Symmetric Encryption Techniques
Symmetric Encryption Techniques
 
Cryptography
CryptographyCryptography
Cryptography
 
Classical Encryption Techniques
Classical Encryption TechniquesClassical Encryption Techniques
Classical Encryption Techniques
 

Dernier

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 

Dernier (20)

Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 

Introduction to Cryptography Parts II and III

  • 1. Presentation is based on the book „Understanding Cryptography – A Textbook for Students and Practitioners“ by Christof Paar and Jan Pelzl www.crypto-textbook.com Parts II and III– Introduction to Cryptography These slides were prepared by Christof Paar, Jan Pelzl and Maksim Djackov
  • 2. 2/36 Understanding Cryptography by Christof Paar and Jan Pelzl Some legal stuff: Terms of Use • The slides can used free of charge. All copyrights for the slides remain with Christof Paar and Jan Pelzl. • The title of the accompanying book “Understanding Cryptography” by Springer and the author’s names must remain on each slide. • If the slides are modified, appropriate credits to the book authors and the book title must remain within the slides. • It is not permitted to reproduce parts or all of the slides in printed form whatsoever without written consent by the authors.
  • 3. 3/36 Understanding Cryptography by Christof Paar and Jan Pelzl  Further Reading and Information Addition to Understanding Cryptography . • A.Menezes, P. van Oorschot, S. Vanstone, Handbook of Applied Cryptography. CRC Press, October 1996. • H.v.Tilborg (ed.), Encyclopedia of Cryptography and Security, Springer, 2005 History of Cryptography (great bedtime reading) • S. Singh, The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography, Anchor, 2000. • D. Kahn, The Codebreakers: The Comprehensive History of Secret Communication from Ancient Times to the Internet. 2nd edition, Scribner, 1996. Software (excellent demonstration of many ancient and modern ciphers) • Cryptool, http://www.cryptool.de
  • 4. 4/36 Understanding Cryptography by Christof Paar and Jan Pelzl Part II
  • 5. Content of this Chapter • Random number generators (RNGs) 5/27 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 6.  Random number generators (RNGs) RNG Cryptographically Secure RNG Pseudorandom NGTrue RNG 6/27 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 7.  True Random Number Generators (TRNGs) • Based on physical random processes: coin flipping, dice rolling, semiconductor noise, radioactive decay, mouse movement, clock jitter of digital circuits • Output stream si should have good statistical properties: Pr(si = 0) = Pr(si = 1) = 50% (often achieved by post-processing) • Output can neither be predicted nor be reproduced Typically used for generation of keys, nonces (used only-once values) and for many other purposes 7/27 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 8.  Pseudorandom Number Generator (PRNG) • Generate sequences from initial seed value • Typically, output stream has good statistical properties • Output can be reproduced and can be predicted Often computed in a recursive way: ),...,,( 11 0 tiiii sssfs seeds    Example: rand() function in ANSI C: 31 1 0 2mod123451103515245 12345    ii ss s Most PRNGs have bad cryptographic properties! 8/27 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 9.  Cryptographically Secure Pseudorandom Number Generator (CSPRNG) • Special PRNG with additional property: • Output must be unpredictable More precisely: Given n consecutive bits of output si , the following output bits sn+1 cannot be predicted (in polynomial time). • Needed in cryptography, in particular for stream ciphers • Remark: There are almost no other applications that need unpredictability, whereas many, many (technical) systems need PRNGs. 9/27 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 10.  Cryptographically Secure Pseudorandom Number Generator (CSPRNG) (taken from Wikipedia.org) CSPRNG designs are divided into three classes: 1. Those based on cryptographic primitives such as ciphers and cryptographic hashes 2. Those based upon mathematical problems thought to be hard 3. Special-purpose designs. The last often introduce additional entropy when available and, strictly speaking, are not "pure" pseudorandom number generators, as their output is not completely determined by their initial state. This addition can prevent attacks even if the initial state is compromised. Example: s(i+1) = SHA-1(s) is a PRNG or CSPRNG? What makes it different from using one of the symmetric stream ciphers as a CSPRNG? Can we predict s(i+1) when using SHA-1 and not knowing initial seed? Stream cipher? 10/27 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 11. 11/36 Understanding Cryptography by Christof Paar and Jan Pelzl Part III
  • 12. 12 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 13. 13 Two properties of symmetric (secret-key) crypto-systems: • The same secret key K is used for encryption and decryption • Encryption and Decryption are very similar (or even identical) functions  Symmetric Cryptography revisited eK(x) dK(y)x y x KK Alice Bob Understanding Cryptography by Christof Paar and Jan Pelzl
  • 14. 14  Symmetric Cryptography: Analogy Understanding Cryptography by Christof Paar and Jan Pelzl K K Safe with a strong lock, only Alice and Bob have a copy of the key • Alice encrypts  locks message in the safe with her key • Bob decrypts  uses his copy of the key to open the safe
  • 15. • Symmetric algorithms, e.g., AES or 3DES, are very secure, fast & widespread but: • Key distribution problem: The secret key must be transported securely • Number of keys: In a network, each pair of users requires an individual key  n users in the network require keys, each user stores (n-1) keys • Alice or Bob can cheat each other, because they have identical keys. Example: Alice can claim that she never ordered a TV on-line from Bob (he could have fabricated her order). To prevent this: „non-repudiation“ 15  Symmetric Cryptography: Shortcomings Example: 6 users (nodes) keys (edges) Understanding Cryptography by Christof Paar and Jan Pelzl 15 2 56  
  • 16. 16 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 17. New Idea: Use the „good old mailbox“ principle: Everyone can drop a letter But: Only the owner has the correct key to open the box 17  Idea behind Asymmetric Cryptography Understanding Cryptography by Christof Paar and Jan Pelzl 1976: first publication of such an algorithm by Whitfield Diffie and Martin Hellman,and also by Ralph Merkle.
  • 18. 18  Asymmetric (Public-Key) Cryptography Principle: “Split up” the key K Public Key (Kpub) (Encrypt) Secret Key (Kpr) (Decrypt) Understanding Cryptography by Christof Paar and Jan Pelzl  During the key generation, a key pair Kpub and Kpr is computed
  • 19. 19  Asymmetric Cryptography: Analogy Understanding Cryptography by Christof Paar and Jan Pelzl Safe with public lock and private lock: • Alice deposits (encrypts) a message with the - not secret - public key Kpub • Only Bob has the - secret - private key Kpr to retrieve (decrypt) the message (Kpub) (Kpr)
  • 20. 20 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 21. 21  Basic Protocol for Public-Key Encryption Alice Bob (KpubB,KprB) = KKpubB x y=eKpubB (x) y x=dKprB (y) Understanding Cryptography by Christof Paar and Jan Pelzl  Key Distribution Problem solved * *) at least for now; public keys need to be authenticated, cf.Chptr. 13 of Understanding Cryptogr.
  • 22. 22  Security Mechanisms of Public-Key Cryptography Here are main mechanisms that can be realized with asymmetric cryptography: • Key Distribution (e.g., Diffie-Hellman key exchange, RSA) without a pre- shared secret (key) • Nonrepudiation and Digital Signatures (e.g., RSA, DSA or ECDSA) to provide message integrity • Identification, using challenge-response protocols with digital signatures • Encryption (e.g., RSA / Elgamal) Disadvantage: Computationally very intensive (1000 times slower than symmetric Algorithms!) Understanding Cryptography by Christof Paar and Jan Pelzl
  • 23. 23  Basic Key Transport Protocol 1/2 In practice: Hybrid systems, incorporating asymmetric and symmetric algorithms 1. Key exchange (for symmetric schemes) and digital signatures are performed with (slow) asymmetric algorithms 2. Encryption of data is done using (fast) symmetric ciphers, e.g., block ciphers or stream ciphers Understanding Cryptography by Christof Paar and Jan Pelzl
  • 24.  Basic Key Transport Protocol 2/2 Alice 24 Understanding Cryptography by Christof Paar and Jan Pelzl Bob y1 = eKpubB (K) y1 K = dKprB (y1) Key Exchange (asymmetric) y2 = AESK (x) x = AES-1 K (y2) y2 Data Encryption (symmetric) (KpubB,KprB) = K KpubB Choose random symmetric key K message x Example: Hybrid protocol with AES as the symmetric cipher
  • 25.  Key Transport Protocol Example 25 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 26. 26 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 27. 27  How to build Public-Key Algorithms Asymmetric schemes are based on a „one-way function“ f(): • Computing y = f(x) is computationally easy • Computing x = f-1(y) is computationally infeasible One way functions are based on mathematically hard problems. Three main families: • Factoring integers (RSA, ...): Given a composite integer n, find its prime factors (Multiply two primes: easy) • Discrete Logarithm (Diffie-Hellman, Elgamal, DSA, …): Given a, y and m, find x such that ax = y mod m (Exponentiation ax : easy) • Elliptic Curves (EC) (ECDH, ECDSA): Generalization of discrete logarithm Note: The problems are considered mathematically hard, but no proof exists (so far). Understanding Cryptography by Christof Paar and Jan Pelzl
  • 28. 28  Key Lengths and Security Levels Symmetric ECC RSA, DL Remark 64 Bit 128 Bit  700 Bit Only short term security (a few hours or days) 80 Bit 160 Bit  1024 Bit Medium security (except attacks from big governmental institutions etc.) 128 Bit 256 Bit  3072 Bit Long term security (without quantum computers) • The exact complexity of RSA (factoring) and DL (Index-Calculus) is difficult to estimate • The existence of quantum computers would probably be the end for ECC, RSA & DL (at least 2-3 decades away, and some people doubt that QC will ever exist) Understanding Cryptography by Christof Paar and Jan Pelzl
  • 29. 29 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 30. 30 Understanding Cryptography by Christof Paar and Jan Pelzl The RSA Cryptosystem • Martin Hellman and Whitfield Diffie published their landmark public- key paper in 1976 • Ronald Rivest, Adi Shamir and Leonard Adleman proposed the asymmetric RSA cryptosystem in1977 • Until now, RSA is the most widely use asymmetric cryptosystem although elliptic curve cryptography (ECC) becomes increasingly popular • RSA is mainly used for two applications • Transport of (i.e., symmetric) keys (cf. Chptr 13 of Understanding Cryptography) • Digital signatures (cf. Chptr 10 of Understanding Cryptography)
  • 31. 31 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 32. • Proposed in 1976 by Whitfield Diffie and Martin Hellman • Widely used, e.g. in Secure Shell (SSH), Transport Layer Security (TLS), and Internet Protocol Security (IPSec) • The Diffie–Hellman Key Exchange (DHKE) is a key exchange protocol and not used for encryption (For the purpose of encryption based on the DHKE, ElGamal can be used.)  Diffie–Hellman Key Exchange: Overview 32 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 33.  Diffie–Hellman Key Exchange •https://vimeo.com/67469421 33 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 34. 34 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 35. 35 Understanding Cryptography by Christof Paar and Jan Pelzl  Motivation • Alice orders a pink car from the car salesmen Bob • After seeing the pink car, Alice states that she has never ordered it: • How can Bob prove towards a judge that Alice has ordered a pink car? (And that he did not fabricate the order himself)  Symmetric cryptography fails because both Alice and Bob can be malicious  Can be achieved with public-key cryptography
  • 36. 36 Understanding Cryptography by Christof Paar and Jan Pelzl  Basic Principle of Digital Signatures
  • 37. 37 Understanding Cryptography by Christof Paar and Jan Pelzl  Main idea • For a given message x, a digital signature is appended to the message (just like a conventional signature). • Only the person with the private key should be able to generate the signature. • The signature must change for every document. The signature is realized as a function with the message x and the private key as input. The public key and the message x are the inputs to the verification function.
  • 38. 38 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 39. 39 Understanding Cryptography by Christof Paar and Jan Pelzl Motivation Problem: Naive signing of long messages generates a signature of same length. • Three Problems • Computational overhead • Message overhead • Security limitations • For more info see Section 11.1 in “Understanding Cryptography”. Solution: Instead of signing the whole message, sign only a digest (=hash) Also secure, but much faster Needed: Hash Functions
  • 40. 40 Understanding Cryptography by Christof Paar and Jan Pelzl Notes: • x has fixed length • z, y have fixed length • z, x do not have equal length in general • h(x) does not require a key. • h(x) is public. x zi = h( xi || zi-1 ) sigkpr z) xi z y = sigkpr (z)  Digital Signature with a Hash Function
  • 41. 41 Understanding Cryptography by Christof Paar and Jan Pelzl  Basic Protocol for Digital Signatures with a Hash Function: Alice Bob z = h(x) s = sigKpr (z) (x, s) z' = h(x) verKpub (s,z')=true/false Kpub
  • 42. 42 Understanding Cryptography by Christof Paar and Jan Pelzl  Principal input–output behavior of hash functions
  • 43. 43 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 44. 44 Understanding Cryptography by Christof Paar and Jan Pelzl  Hash Funktionen: Algorithms • MD5 - family • SHA-1: output - 160 Bit; input - 512 bit chunks of message x; operations - bitwise AND, OR, XOR, complement und cyclic shifts. • RIPE-MD 160: output - 160 Bit; input - 512 bit chunks of message x; operations – like in SHA-1, but two in parallel and combinations of them after each round. Hash Algorithms based on block ciphers Special Algorithms, e.g. MD5 - family
  • 45. 45 Content of this Chapter • Symmetric Cryptography Revisited • Principles of Asymmetric Cryptography • Practical Aspects of Public-Key Cryptography • Important Public-Key Algorithms • The RSA Cryptosystem • Diffie–Hellman Key Exchange • The Principle of Digital Signatures • Why We Need Hash Functions • Hash Algorithms • Asymmetric Key Distribution • Certificates Understanding Cryptography by Christof Paar and Jan Pelzl
  • 46.  Certificates  In order to authenticate public keys (and thus, prevent the MIM attack) , all public keys are digitally signed by a central trusted authority.  Such a construction is called certificate certificate = public key + ID(user) + digital signature over public key and ID  In its most basic form, a certificate for the key kpub of user Alice is: Cert(Alice) = (kpub, ID(Alice), sigKCA (kpub,ID(Alice) )  Certificates bind the identity of user to her public key  The trusted authority that issues the certificate is referred to as certifying authority (CA)  „Issuing certificates“ means in particular that the CA computes the signature sigKCA (kpub) using its (super secret!) private key kCA  The party who receives a certificate, e.g., Bob, verifies Alice‘s public key using the public key of the CA 46 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 47. • In the wild certificates contain much more information than just a public key and a signature. • X509 is a popular signature standard. The main fields of such a certificate are shown to the right. • Note that the „Signature“ at the bottom is computed over all other fields in the certifcate (after hashing of all those fields). • It is important to note that there are two public-key schemes involved in every certificate: 1. The public-key that actually is protected by the signature („Subject‘s Public Key“ on the right). This was the public Diffie-Hellman key in the earlier examples. 2. The digital signature algorithm used by the CA to sign the certificate data. • For more information on certificates, see Section 13.3 of Understanding Cryptography  Certificates in the Real World 48 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 48. There are many additional problems when certificates are to be used in systems with a large number of participants. The more pressing ones are: 1.Users communicate which other whose certificates are issued by different CAs • This requires cross-certification of CAs, e.g.. CA1 certifies the public-key of CA2. If Alice trusts „her“ CA1, cross-certification ensures that she also trusts CA2. This is called a „chain of trust“ and it is said that „trust is delegated“. 2.Certificate Revocation Lists (CRLs) • Another real-world problem is that certificates must be revoced, e.g., if a smart card with certificate is lost or if a user leaves an organization. For this, CRLs must be sent out periodically (e.g., daily) which is a burden on the bandwidth of the system. More information on PKIs and CAs can be found in Section 13.3 of Understanding Cryptography  Remaining Issues with PKIs 49 Understanding Cryptography by Christof Paar and Jan Pelzl
  • 49. 50  Lessons Learned • Public-key algorithms have capabilities that symmetric ciphers don’t have, in particular digital signature and key establishment functions. • Public-key algorithms are computationally intensive (a nice way of saying that they are slow), and hence are poorly suited for bulk data encryption. • Only three families of public-key schemes are widely used. This is considerably fewer than in the case of symmetric algorithms. • RSA is the most widely used public-key cryptosystem • RSA is mainly used for key transport and digital signatures • The Diffie–Hellman protocol is a widely used method for key exchange. It is based on cyclic groups. • Digital signatures provide message integrity, message authentication and non- repudiation. • RSA is currently the most widely used digital signature algorithm. • Hash functions are keyless. The two most important applications of hash functions are their use in digital signatures and in message authentication codes such as HMAC. Understanding Cryptography by Christof Paar and Jan Pelzl