Digital Signatures: Mathematics Zdeněk Říha. Data authentication Data integrity + data origin Digital signature Asymmetric cryptography public and private.

Slides:



Advertisements
Similar presentations
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Advertisements

Cryptography and Network Security
Digital Signatures and Hash Functions. Digital Signatures.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CNS2010handout 10 :: digital signatures1 computer and network security matt barrie.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
Digital Signature Algorithm (DSA) Kenan Gençol presented in the course BIL617 Cryptology instructed by Asst.Prof.Dr. Nuray AT Department of Computer Engineering,
Kemal AkkayaWireless & Network Security 1 Department of Computer Science Southern Illinois University Carbondale CS 591 – Wireless & Network Security Lecture.
Announcements: 1. HW6 due now 2. HW7 posted Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Cryptography1 CPSC 3730 Cryptography Chapter 13 Digital Signature Standard (DSS)
Chapter 3 Encryption Algorithms & Systems (Part C)
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
1 Pertemuan 08 Public Key Cryptography Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Lecture 4 Cryptographic Tools (cont) modified from slides of Lawrie Brown.
CSE 597E Fall 2001 PennState University1 Digital Signature Schemes Presented By: Munaiza Matin.
Digital Signatures Presented by Olga Shishenina. 2 Outline  Cryptographic goals  Message Authentication Codes (MACs)  Digital signatures RSA digital.
Network Security Essentials Fifth Edition by William Stallings Fifth Edition by William Stallings.
Cryptography and Network Security Chapter 13
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
Digital Signatures (DSs) The digital signatures cannot be separated from the message and attached to another The signature is not only tied to signer but.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Information Security and Management 13. Digital Signatures and Authentication Protocols Chih-Hung Wang Fall
CS5204 – Fall Cryptographic Security Presenter: Hamid Al-Hamadi October 13, 2009.
Lecture 8 Digital Signatures. This lecture considers techniques designed to provide the digital counterpart to a handwritten signature. A digital signature.
Bob can sign a message using a digital signature generation algorithm
1 Lect. 15 : Digital Signatures RSA, ElGamal, DSA, KCDSA, Schnorr.
By Abhijith Chandrashekar and Dushyant Maheshwary.
The RSA Algorithm Rocky K. C. Chang, March
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
© Neeraj Suri EU-NSF ICT March 2006 DEWSNet Dependable Embedded Wired/Wireless Networks MUET Jamshoro Computer Security: Principles and Practice Slides.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Elliptic Curve Cryptography
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 10 – Digital Signatures.
Digital Signatures A primer 1. Why public key cryptography? With secret key algorithms Number of key pairs to be generated is extremely large If there.
1 Lect. 13 : Public Key Encryption RSA ElGamal. 2 Shamir Rivest Adleman RSA Public Key Systems  RSA is the first public key cryptosystem  Proposed in.
Chapter 21 Public-Key Cryptography and Message Authentication.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Computer and Network Security Rabie A. Ramadan Lecture 6.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CS461/ECE422 Spring 2012 Nikita Borisov — UIUC1.  Text Chapters 2 and 21  Handbook of Applied Cryptography, Chapter 8 
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 2 – Cryptographic.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
1 Number Theory and Advanced Cryptography 6. Digital Signature Chih-Hung Wang Sept Part I: Introduction to Number Theory Part II: Advanced Cryptography.
Cryptographic Hash Functions and Protocol Analysis
Information Security CS 526
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Prepared by Dr. Lamiaa Elshenawy
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 11 September 23, 2004.
Digital Signature Standard (DSS) US Govt approved signature scheme designed by NIST & NSA in early 90's published as FIPS-186 in 1991 revised in 1993,
1 Cryptanalysis Lab Elliptic Curves. Cryptanalysis Lab Elliptic Curves 2 Outline [1] Elliptic Curves over R [2] Elliptic Curves over GF(p) [3] Properties.
@Yuan Xue 285: Network Security CS 285 Network Security Digital Signature Yuan Xue Fall 2012.
Public Key Cryptosystem
Information Security message M one-way hash fingerprint f = H(M)
Public Key Encryption and Digital Signatures
Information Security message M one-way hash fingerprint f = H(M)
ICS 454 Principles of Cryptography
Information Security message M one-way hash fingerprint f = H(M)
ICS 454 Principles of Cryptography
Digital Signatures…!.
Diffie-Hellman Key Exchange
LAB 3: Digital Signature
Presentation transcript:

Digital Signatures: Mathematics Zdeněk Říha

Data authentication Data integrity + data origin Digital signature Asymmetric cryptography public and private key

Kerckhoffs' principle A cryptosystem should be secure even if everything about the system, except the key, is public knowledge. I.e. only the key should be kept secret, not the algorithm.

Signature algorithm Verification algorithm message signed message Alice Public key of Alice Bob Source: Network and Internetwork Security (Stallings) Digital signature scheme verified message Private key of Alice

Digital signature – keys Two keys per subject: Private key for signature generation; Public key for signature verification. Correct signatures can be generated only by those having the private key… To verify the signature we need the public key of the signed subject. The digital signature itself does not give any guarantees with respect to signing time.

Digital signature – algorithms First asymmetric cryptography algorithms appeared at the beginning of 1970s: British GCHQ (Clifford Cocks). Public announcement in Application of the asymmetric algorithms for authentication - signature “invented” later by the academic community for their algorithms. First public algorithms at the end of 1970s (W. Diffie and M. Hellman influenced by R. Merkle). The famous algorithm RSA (Rivest, Shamir, Adelman) published in 1977, patented in 1983 (patent has already expired). Described in PKCS#1

Digital Signature Algorithm (DSA) Proposed in 1991 by NIST In 1994 the selection procedure for Digital Signature Standard (DSS) was concluded – DSA (Digital Signature Algorithm) was selected. Modified version of ElGamal algorithm, based on discrete logarithm in Z p. Became FIPS standard FIPS 186 in Slightly modified in 1996 as FIPS Extended in 2000 as FIPS Updated in 2009 as FIPS (new key sizes). Now NIST FIPS supports RSA & DSA & ECDSA.

Elliptic curve DSA (ECDSA) Elliptic curves invented by Koblitz & Miller in ECDSA proposed in 1992 by Vanstone Became ISO standard (ISO ) in 1998 Became ANSI standard (ANSI X9.62) in 1999 ECDSA is a version of DSA based on elliptic curves.

RSA: mathematics Prime multiplication is simple & Factorization of integers is computationally intensive. We choose randomly 2 primes and compute n and φ(n) : p, q n = p·q φ(n) = (p-1)(q-1). e is chosen such that gcd(e, φ(n)) = 1. We compute d = e -1 (mod φ(n)). Public key: n, e. Private parameters: p, q, d. Private key: d. Digital signature generation (decryption): s = m d mod n Signature verification (encryption): m = s e mod n. For RSA with 1024 bit n, the signature will be 1024 bit long.

RSA: example Intentionally small numbers (such cryptosystem is not secure). We generate parameters: p = 7927, q = 6997, n = pq = , φ(n) = 7926  6996 = Public exponent is selected e = 5, equation is solved ed = 5d = 1 (mod ) to have d = The public key: (n = , e = 5), The private key: d = Digital signature generation: Message m = Signature s = mod = Signature verification: Message should be m = mod =

RSA in practice: Padding  (M) = 6b bb … bb ba || Hash(M) || 3x cc where x = 3 for SHA-1, 1 for RIPEMD-160 ANSI X9.31  (M) = ff … ff 00 || HashAlgID || Hash(M) PKCS #1 v1.5  (M) = 00 || H || G(H)  [salt || 00 … 00] where H = Hash(salt, M), salt is random, and G is a mask generation function Probabilistic Signature Scheme (PSS)

RSA Padding example (PKCS#1 v1.5) Document “ ” Hash of the document (sha-1) “b c d2 a0 10 e eb e5 b c 5d ” Padded hash to be signed “00 01 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff b 0e a b c d2 a0 10 e eb e5 b c 5d ”

DSA: mathematics Key generation – domain parameters Decide on a key length L and N, e.g. (1024,160). N must be less than or equal to the hash output length Choose an N-bit prime q. [“order of g w.r.t p”] Choose an L-bit prime modulus p such that p–1 is a multiple of q. Choose g, a number whose multiplicative order modulo p is q, e.g. g = h (p–1)/q mod p for some arbitrary h (1 < h < p-1). [“generator”] Domain parameters (p, q, g) may be shared between different users of the DSA system.

DSA: mathematics II Key generation Choose random x, such that 0 < x < q. Calculate y = g x mod p. Private key: x. Public key: y & (p, q, g).

DSA: mathematics III Signature generation Generate a random per-message value k such that 0 < k < q. Calculate r = (g k mod p) mod q Calculate s = (k −1 (H(m) + x*r)) mod q The signature is (r, s). Signature verification w = (s) −1 mod q u1 = (H(m)*w) mod q u2 = (r*w) mod q v = ((g u1 *y u2 ) mod p) mod q The signature is valid if v = r For DSA (1024,160) the signature size will be 2x160 bits.

DSA: Padding Decide on lengths L and N, e.g. (1024,160). N must be less than or equal to the hash output length E.g. for (1024,160) sha-1 is typically used, sha-256 would be ok as well and only first 160 bits would be used s = (k −1 (H(m) + x*r)) mod q “It is recommended that the security strength of the (L, N) pair and the security strength of the hash function used for the generation of digital signatures be the same unless an agreement has been made between participating entities to use a stronger hash function. When the length of the output of the hash function is greater than N (i.e., the bit length of q), then the leftmost N bits of the hash function output block shall be used in any calculation using the hash function output during the generation or verification of a digital signature. A hash function that provides a lower security strength than the (L, N) pair ordinarily should not be used, since this would reduce the security strength of the digital signature process to a level no greater than that provided by the hash function.” [FIPS 186-3]

ECDSA: Elliptic curves Elliptic curve Points satisfying equation y 2 = x 3 + ax +b And a point in infinity (∞) Set of points & operations form an Abelian group In ECC (elliptic curve cryptography) elliptic curves over finite fields are used Prime fields: F p, p prime Extension fields of characteristics 2: F 2 m Finding the discrete logarithm of a random elliptic curve element with respect to a publicly-known base point is infeasible.

ECDSA: Elliptic curve domain parameters (field,a,b,G,n,h) Finite field p for F p m, bases (trinomial, pentanomial) for F 2 m Coefficients a, b: y 2 = x 3 + ax +b Group generator: G Order of the G: n Optional cofactor: h (h = number of elements in field / order n) The base point G generates a cyclic subgroup of order n in the field.

ECDSA: Keys Generating key pair Select a random integer d from [1,n − 1] Compute P = d*G; Private key: d Public key: P For 256-bit curve the private key d will be approx. 256-bit long the public key P is a point on the curve – will be approx 512-bit long

ECDSA: Signatures Generate signature Select a random integer k from [1,n − 1] (x 1,y 1 ) = k*G Calculate r = x 1 (mod n) Calculate s = k −1 (M + r*d) (mod n) Signature is (r,s). Signature verification Calculate w = s −1 (mod n) Calculate u 1 = z*w (mod n) & u 2 = r*w (mod n) Calculate (x 1,y 1 ) = u 1 *G + u 2 *P The signature is valid if r = x 1 (mod n). For 256-bit curve the signature length will be approx. 512 bits

ECDSA: Padding Rules are same as for DSA “It is recommended that the security strength associated with the bit length of n and the security strength of the hash function be the same unless an agreement has been made between participating entities to use a stronger hash function. When the length of the output of the hash function is greater than the bit length of n, then the leftmost n bits of the hash function output block shall be used in any calculation using the hash function output during the generation or verification of a digital signature. A hash function that provides a lower security strength than the security strength associated with the bit length of n ordinarily should not be used, since this would reduce the security strength of the digital signature process to a level no greater than that provided by the hash function.” [FIPS 186-3]

Hash function Cryptographic hash function Input of arbitrary size Output of fixed size: n bits (e.g. 256 bits). Function is not injective (there are collisions). Hash is a compact representative of input (also called imprint, (digital) fingerprint or message digest). Hash functions often used to protect integrity. First the has is computed and then only the has is protected (e.g. digitally signed).

Hash function properties One-way property It is easy to calculate h(x) for arbitraty x. In a reasonable time it is not possible for the fixed y to find x, such that h(x) = y. Collision resistance (weak): In a reasonable time it is not possible for a given x to find x’ (x ≠ x’) such that h(x) = h(x’). (strong): In a reasonable time it is not possible to find any x, x’ such that h(x) = h(x’).

Cryptographic hash functions MD4: output 128 bits not used anymore, serious weaknesses found. MD5: output 128 bits Still used although not considered secure at all Broken: efficient algorithm for finding collisions available 128-bit output not considered secure enough SHA-1 (Secure Hash Algorithm): output 160 bits NIST standard, used in DSS (Digital Signature Standard) Not recommended for longer term use.

Cryptographic hash functions RIPEMD Output : 128, 160, 256 or 320 bits Less frequently used Whirlpool Output: 512 bits Based on AES Recommended by NESSIE project Standardized by ISO

Cryptographic hash functions SHA-2 SHA-256, SHA-384, SHA-512, SHA-224 Defined in FIPS Recommended hash functions SHA-3 Selection of the future standard hash function is currently in progress Winner expected in 2012

Hash functions - examples MD5 Input: „Autentizace“. Output: 2445b187f d5411c7. Output 128 bits, written in hexadecimal notation. Input: „Cutentizace“. Output: cd99abbba e90270bf015b36a7. A single bit changed in input → big change in output, so called “Avalanche effect” SHA-1 Input: „Autentizace“. Output: cd2a6c953cf5c29d36e0ad14e395ed1776 SHA-256 Input: „Autentizace“. Output: a2eb4bc98a5f71a4db02ed4aed7f12c4ead1e7c98323fda8ecbb69282e4df584