Public Key Cryptography. Performance Comparison and Benchmarking



Similar documents
Signature Schemes. CSG 252 Fall Riccardo Pucella

The Mathematics of the RSA Public-Key Cryptosystem

CRYPTOGRAPHY IN NETWORK SECURITY

Elements of Applied Cryptography Public key encryption

Public Key (asymmetric) Cryptography

Digital Signatures. Murat Kantarcioglu. Based on Prof. Li s Slides. Digital Signatures: The Problem

Study of algorithms for factoring integers and computing discrete logarithms

Network Security. Security Attacks. Normal flow: Interruption: 孫 宏 民 Phone: 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室

Overview of Public-Key Cryptography

Digital Signatures. (Note that authentication of sender is also achieved by MACs.) Scan your handwritten signature and append it to the document?

Forward Secrecy: How to Secure SSL from Attacks by Government Agencies

Table of Contents. Bibliografische Informationen digitalisiert durch

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

Cryptography and Network Security

Computer Security: Principles and Practice

Cryptographic Algorithms and Key Size Issues. Çetin Kaya Koç Oregon State University, Professor

Digital Signature. Raj Jain. Washington University in St. Louis

2. Cryptography 2.4 Digital Signatures

Final Exam. IT 4823 Information Security Administration. Rescheduling Final Exams. Kerberos. Idea. Ticket

CIS 5371 Cryptography. 8. Encryption --

Cryptography Lecture 8. Digital signatures, hash functions

Digital Signatures. Meka N.L.Sneha. Indiana State University. October 2015

An Approach to Shorten Digital Signature Length

Implementation of Elliptic Curve Digital Signature Algorithm

Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY. Sourav Mukhopadhyay

A SOFTWARE COMPARISON OF RSA AND ECC

CSCE 465 Computer & Network Security

Ashraf Abusharekh Kris Gaj Department of Electrical & Computer Engineering George Mason University

Digital Signature CHAPTER 13. Review Questions. (Solution to Odd-Numbered Problems)

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Notes on Network Security Prof. Hemant K. Soni

A New Generic Digital Signature Algorithm

Network Security. Chapter 2 Basics 2.2 Public Key Cryptography. Public Key Cryptography. Public Key Cryptography

DIGITAL SIGNATURES 1/1

Cryptography and Network Security Chapter 10

Computer Science A Cryptography and Data Security. Claude Crépeau

NEW DIGITAL SIGNATURE PROTOCOL BASED ON ELLIPTIC CURVES

Public Key Cryptography Overview

Introduction to Cryptography CS 355

Secure File Transfer Using USB

QUANTUM COMPUTERS AND CRYPTOGRAPHY. Mark Zhandry Stanford University

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

Improved Online/Offline Signature Schemes

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

MATH 168: FINAL PROJECT Troels Eriksen. 1 Introduction

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

ECE 842 Report Implementation of Elliptic Curve Cryptography

Outline. CSc 466/566. Computer Security. 8 : Cryptography Digital Signatures. Digital Signatures. Digital Signatures... Christian Collberg

Software Tool for Implementing RSA Algorithm

RSA Attacks. By Abdulaziz Alrasheed and Fatima

Transitions: Recommendation for Transitioning the Use of Cryptographic Algorithms and Key Lengths

Public-Key Cryptanalysis

A New Efficient Digital Signature Scheme Algorithm based on Block cipher

COMPARISON AND EVALUATION OF DIGITAL SIGNATURE SCHEMES EMPLOYED IN NDN NETWORK

Capture Resilient ElGamal Signature Protocols

1 Signatures vs. MACs

Implementation and Comparison of Various Digital Signature Algorithms. -Nazia Sarang Boise State University

Computer and Network Security

Evaluation of Digital Signature Process

An Efficient and Secure Key Management Scheme for Hierarchical Access Control Based on ECC

Cryptography and Network Security Chapter 9

CS 758: Cryptography / Network Security

Chapter 11 Security+ Guide to Network Security Fundamentals, Third Edition Basic Cryptography

Introduction. Digital Signature

Software Implementation of Gong-Harn Public-key Cryptosystem and Analysis

ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING

Secure Network Communication Part II II Public Key Cryptography. Public Key Cryptography

Cryptographic hash functions and MACs Solved Exercises for Cryptographic Hash Functions and MACs

White Paper. Enhancing Website Security with Algorithm Agility

SECURITY IMPROVMENTS TO THE DIFFIE-HELLMAN SCHEMES

RSA and Primality Testing

Public Key Cryptography. c Eli Biham - March 30, Public Key Cryptography

7! Cryptographic Techniques! A Brief Introduction

A Factoring and Discrete Logarithm based Cryptosystem

Crittografia e sicurezza delle reti. Digital signatures- DSA

Elliptic Curve Cryptography

A Question of Key Length

Digital Signatures. Prof. Zeph Grunschlag

Implementing Network Security Protocols

Public Key Cryptography of Digital Signatures

Network Security [2] Plain text Encryption algorithm Public and private key pair Cipher text Decryption algorithm. See next slide

Elliptic Curve Cryptography Methods Debbie Roser Math\CS 4890

Digital Signature Standard (DSS)

SFWR ENG 4C03 - Computer Networks & Computer Security

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

EXAM questions for the course TTM Information Security May Part 1

Paillier Threshold Encryption Toolbox

Smart card implementation of a digital signature scheme for Twisted Edwards curves

Certicom Security for Government Suppliers developing client-side products to meet the US Government FIPS security requirement

THE ADVANTAGES OF ELLIPTIC CURVE CRYPTOGRAPHY FOR WIRELESS SECURITY KRISTIN LAUTER, MICROSOFT CORPORATION

IMPROVED SECURITY MEASURES FOR DATA IN KEY EXCHANGES IN CLOUD ENVIRONMENT

Lecture 6 - Cryptography

Lukasz Pater CMMS Administrator and Developer

Transcription:

Public Key Cryptography Performance Comparison and Benchmarking Tanja Lange Department of Mathematics Technical University of Denmark tanja@hyperelliptic.org 28.08.2006 Tanja Lange Benchmarking p. 1

What is the Fastest Public Key Cryptosystem? Tanja Lange Benchmarking p. 2

Fastest Public Key system... for key agreement? for electronic signature? for encryption? for key generation? Decision will depend on application and resources like low power embedded device, personal computer or laptop, or server handling millions of connections. Even with complete specifications it is hard to decide from the theoretical description which is faster. Tanja Lange Benchmarking p. 3

RSA n = p q, p, q primes. Choose random e, compute d e 1 mod ϕ(n) (if possible); ϕ(n) = (p 1)(q 1). Public key (e, n). Secret key d. Example: signing of message m with hash function h (school book version!) Signer: Compute h(m) and send s h(m) d mod n as signature. Verifier: Compute h s e mod n. Accept only if h = h(m). Tanja Lange Benchmarking p. 4

n = p q, p, q primes. RSA Choose small e, compute d e 1 mod ϕ(n) (if possible); ϕ(n) = (p 1)(q 1). Public key (e, n). Secret key d. Example: signing of message m with hash function h (school book version!) Signer: Compute h(m) and send s h(m) d mod n as signature. Verifier: Compute h s e mod n. Accept only if h = h(m). Tanja Lange Benchmarking p. 4

Costs of RSA signature Signer computes hash and computes 1 modular exponentiation. Verifier computes hash and computes 1 modular exponentiation. If RSA with small public exponent is used, verification gets cheaper. Costs for encryption are similar. Tanja Lange Benchmarking p. 5

DL in finite fields General system parameters: p prime power, IF p finite field with p elements. g generator of group of order q, with q p 1. Choose random a, compute h = g a. Public key h. (Note that public parameters are not included, they are assumed to be system-wide parameters.) Secret key a. Tanja Lange Benchmarking p. 6

Schnorr signature on m Signer: Choose k, compute K = g k, compute H = h(k, m). Compute S k ah mod q. Signature is (H, S). Verifier: Retrieve h. Compute K = g S h H. Accept only if H = h(k, m). Works since K = g S h H = g k ah g ah = g k = K if the signature was computed correctly. Tanja Lange Benchmarking p. 7

Costs of Schnorr signature Signer computes hash, 1 modular exponentiation and one multiplication modulo q (much smaller than modulus p). Verifier computes hash and 2 modular exponentiations (usually done as 1 multiexponentiation). So on first sight this is more expensive than RSA if p n. Tanja Lange Benchmarking p. 8

Elliptic curve E : y 2 + (a 1 x + a 3 ) y = x 3 + a } {{ } 2 x 2 + a 4 x + a 6, h, f IF } {{ } q [x]. h(x) f(x) Group: E(IF q ) = { (x, y) IF 2 q : y 2 + h(x)y = f(x) } { P } Often q = 2 r or q = p, prime. Isomorphic transformations lead to y 2 = f(x) for q odd, y 2 + xy = x 3 + a 2 x 2 + a 6 y 2 + y = x 3 + a 4 x + a 6 q = 2 r, curve non-supersingula curve supersingular Tanja Lange Benchmarking p. 9

Group Law in E(IR), h = 0 y 2 = x 3 x P R Tanja Lange Benchmarking p. 10

Group Law in E(IR), h = 0 y 2 = x 3 x P R P R Tanja Lange Benchmarking p. 10

Group Law in E(IR), h = 0 y 2 = x 3 x P R P + R P R Tanja Lange Benchmarking p. 10

Group Law (q odd) E : y 2 = x 3 + a 4 x + a 6, a i IF q Line y = λx + µ has slope P R P R λ = y R y P x R x P. Equating gives (λx + µ) 2 = x 3 + a 4 x + a 6. This equation has 3 solutions, the x-coordinates of P, R and P R, thus (x x P )(x x R )(x x P R ) = x 3 λ 2 x 2 + (a 4 2λµ)x + a 6 x P R = λ 2 x P x R Tanja Lange Benchmarking p. 11

Group Law (q odd) E : y 2 = x 3 + a 4 x + a 6, a i IF q P R P + R Point P is on line, thus y P = λx P + µ, i.e. µ = y P λx P, and y P R = λx P R + µ P R = λx P R + y P λx P = λ(x P R x P ) + y P Point P + R has the same x-coordinate but negative y-coordinate: x P +R = λ 2 x P x R, y P +R = λ(x P x P R ) y P Tanja Lange Benchmarking p. 11

Group Law (q odd) E : y 2 = x 3 + a 4 x + a 6, a i IF q P R 2P 2P P + R P R In general, for (x P, y P ) (x R, y R ): (x P, y P ) + (x R, y R ) = = (x P +R, y P +R ) = = (λ 2 x P x R, λ(x P x P +R ) y P ), where { (y R y P )/(x R x P ) if x P x R, λ = (3x 2 P + a 4)/(2y P ) else. Addition and Doubling need 1 I, 2M, 1S and 1 I, 2M, 2S, respectively Tanja Lange Benchmarking p. 11

Systems based on ECC Use the group of points instead of finite field in previous signature scheme. General system parameters: IF q finite field with q elements. E elliptic curve over IF q, group order n. P generator of group of order l with l n. Choose random a, compute Q = [a]p. Public key Q. (Note that public parameters are not included, they are assumed to be system-wide parameters.) Secret key a. Tanja Lange Benchmarking p. 12

ECDSA signature on m Signer: Choose k, compute K = [k]p. Compute s (k 1 (h(m) ah(k))) mod l Signature is (K, s). Verifier: Retrieve Q. Compute R 1 = [h(k)]q [s]k. Compute R 2 = [h(m)]p. Accept only if R 1 = R 2. Works since R 1 = [h(k)]q [s]k = [ah(k)]p [ks]p = [ah(k) + h(m) ah(k)]p = [h(m)]p = R 2. Tanja Lange Benchmarking p. 13

Costs of ECDSA Signer computes hash, 1 scalar multiplication and one multiplication modulo l. Verifier computes hash, 1 scalar multiplication and 1 multi-exponentiation. Warning: this is not the most efficient version, one multi-exponentiation is sufficient. So the number and type of operations is similar to Schnorr signature, however, each group operation on the elliptic curve is much more complicated than in finite fields (actually composed of several finite field operations). BUT finite fields do NOT have the same size. Tanja Lange Benchmarking p. 14

Fair comparison Systems should offer same level of security! RSA is broken if n can be factored. There are subexponential algorithms for factoring. Schnorr s signature scheme is broken if a can be obtained from h = g a. There are subexponential algorithms to solve the DLP in finite fields. ECDSA is broken if a can be obtained from Q = [a]p. We are not aware of any subexponential algorithm for solving the DLP on elliptic curves. Best known attacks on carefully chosen curves need O( l) operations, so the DLP has exponential security. Hyperelliptic curves of small genus behave like elliptic curves. Tanja Lange Benchmarking p. 15

Implications Asymptotic behavior does not capture constants. ECRYPT s www.ecrypt.eu.org report on key-sizes states security of RSA as Sizes of n, p for RSA and Schnorr signature scheme grow much faster than group size l in ECDSA. Often mentioned current recommendations are RSA or finite fields with 1024 bit modulus; ECC in fields of 160 bits. Often only discrete steps stated and contradicting answers. Nice compilation www.keylength.com. Tanja Lange Benchmarking p. 16

Comparison seems possible For current security level (and thus also for future ones) ECDSA is faster than RSA or DSA in general. RSA with small public key has fast verification. Security is unclear. Implementations in soft- and hardware confirm this. Benchmarks are done (at least on one machine at a time), results usually point in the same direction and confirm above statement. Have theoretical comparison and real world measures (Pentium cycles, Athlon cycles, etc.) However, often implementor prefers his own system are his results significant for other systems? Tanja Lange Benchmarking p. 17

Other systems There are many more systems that are much harder to put into comparison: SFLASH is an HFE based signature system. Merkle-tree signatures are based on hash functions. Coding based systems are around almost since the beginning of public key cryptography and still unbroken. NTRU a lattice based encryption seems secure, NTRUsign is controversial. These systems are interesting in general. Additional advantage: they seem to resist quantum computing attacks (while RSA and DL would be broken completely). Tanja Lange Benchmarking p. 18

ebats ebats: ECRYPT Benchmarking of Asymmetric Systems www.ecrypt.eu.org/ebats benchmark real world measures (Pentium cycles, Athlon cycles, etc.) for generating keys, signing, verifying, encrypting, decrypting; measure key bytes, signed-message bytes, ciphertext bytes, etc. of any submitted BAT (Benchmarkable Asymmetric Tool), i.e. public key system for signing, encrypting or key sharing. Benchmarking tool is called BATMAN (Benchmarking of Asymmetric Tools on Multiple Architectures, Non-Interactively). Tanja Lange Benchmarking p. 19

Advantages BAT is submitted by person supporting this particular system. Only systems that find at least one interested person are considered. Independent benchmarking on a variety of machines. Unifying API so that code can run anywhere. Wrapper to make fixed length encryption/signature handle arbitrary length ones. OpenSSL, GMP and NTL are provided. Tanja Lange Benchmarking p. 20

Disadvantages Only submitted systems are considered might miss some systems. Result depends on programming abilities of submitter might be slower than optimal. Wrapper might be slower than designated encryption/signature of arbitrary length messages. Provided software packages (OpenSSL, GMP, NTL) might not be optimal for small field sizes. Tanja Lange Benchmarking p. 21

ebats approach Some BATs are provided to guarantee presence of RSA, DL in finite fields. BATMAN comes with example BATs. Use of OpenSSL, GMP and NTL is optional. A BAT can come with full code for modular reduction etc. BATMAN tries all conceivable compiler options, also for included software. Source code is put online. Improvements are possible over the full duration of the competition. We accept multiple BATs for the same cryptographic primitive (ronald is a slow RSA BAT). Wrapper is optional. Implementation of full API is very welcome. Tanja Lange Benchmarking p. 22

Example measurements with ronald Just try to beat ronald and submit your BAT! Tanja Lange Benchmarking p. 23

!1 ) $2%34 %.3 )526 2755286388 6526 379 3765862 79 878289. %86298936 "// % *

!1 ) $2%34 726263 <=& 352>>3,=& 3573753>>3 :+$& "// % *, 4:+$. %;

>>3 ))%% 4 $? 676366-$39 8796+ $/ $:2 3573753-$2%3 335235? $"-@ 767387+A 58582+A2B%3 5629A!32!@ "// % *

). 0 %/ %/ &)* + * +C A 'D8* - )/* ///* ** 0