RSA Public Key Encryption 1. Ivor Page 2

Size: px
Start display at page:

Download "RSA Public Key Encryption 1. Ivor Page 2"

Transcription

1 RSA Public Key Encryption 1 RSA Public Key Encryption 1 Ivor Page 2 One of the most important methods of providing secrecy and authentication is encryption. Secrecy means the secure transmission of data to a specified recipient (without others being able to read the data) while authentication means that the recipient can be certain of who sent the data. In practice, it is usually possible for unintended others to receive encrypted messages, but it should be extremely time consuming (thousands of years in some cases) for unintended recipients to decrypt them. There is no perfect cipher - one that can never be broken - but it is possible to make the task of decrypting messages too costly in time for all practical purposes. There have been many famous ciphers that have frustrated attempts to crack them, but the digital computer has brought extremely powerful methods to the aid of cryptanalysts. The computer s ability to enumerate many possible cracking strategies in a very short time makes the problem of selecting tough ciphers much more difficult. We will study the Public Key Encryption System known as RSA after its inventors, Rivest, Shamir and Adleman. The most popular encryption system based on RSA and used by the public is Pretty Good Privacy (PGP). There is a free downloadable version of the software and there are companies that provide key pairs to users of these systems 3. A personal note of caution: You might choose to encrypt all your personal and data but, if you are sued, the court may ask you to decrypt it. Failure to do so is regarded as withholding evidence. It is better not to create messages that might embarrass you later. 1 A Method for Obtaining Digital Signatures and Public Key Cryptosystems R. L. Rivest, A. Shamir, and L. Adleman. Communications of the ACM, Vol. 21, No. 2, February 1978 University of Texas at Dallas 3

2 RSA Public Key Encryption 2 DES DES was introduced for use in U.S. unclassified government applications in Since then it has come under criticism for ease of cracking. It uses a single well publicized algorithm for encryption and decryption. Secrecy is guarded by a single 56 bit key, known only to the sender and recipient. The algorithm partitions each message into 64 bit blocks and makes use of transpositions of groups of bits within each block and an Excusive OR function between the transposed bit sequence and the key. Many argue that the key length is too short and some hackers have published strategies for cracking DES on WEB sites. For more information on DES, RSA, and many other encryption techniques and security matters, consult the text by Dorothy and Robling Denning 4. RSA Each agent A that wishes to communicate has two keys, a public key A p, knowntoeveryonewithwhoma communicates, and a secret key A s,known only to A. A user of an RSA encryption system will generally not memorize these keys. They will be stored in the agents computers. This means that physical security, usually implemented via passwords, is at least as important as the encryption system. Someone could maliciously login to A s computer and send messages in A s name or receive messages that should only be readable by A. Great care must be given to the selection and regular updating of passwords. Many password cracking systems try dictionary words and common names. People often use their dogs names or something equally easy to guess, or they leave their passwords written on notes in their desks. Agents also must not leave their computers logged in while they are not present. It takes only a few seconds for an experienced spy to compromise security. 4 Cryptography and Data Security by Dorothy and Robling Denning, Addison Wesley, 1982, Reprinted with corrections, 1983.

3 RSA Public Key Encryption 3 Secret communication with RSA When A wishes to send a secret message M to B, A uses B s public key to encrypt the message, C = E Bp (M), where C is the ciphertext. Agent B uses B s secret key to decrypt the message, M = D Bs (M). Only B can read the message, but anyone possessing A s public key could have sent it. Agent A Agent B B p B s Message M E ciphertext C D M Figure 1: Secret Communication with RSA Here E and D are the encryption and decryption algorithms. For RSA, the encryption and decryption algorithms are identical and are known to everyone, E = D. Wecallsuchsystemssymmetrical. Authenticated Communication with RSA When A wants to send a message to B signed by a digital signature, A encrypts the message using A s secret key, C = E As (M) andb uses A s public key to decrypt the message, M = E Ap (C). Here, only A could have sent the message, but anyone possessing A s public key can read the message. Agent A Agent B A s A p Message M E ciphertext C D M Figure 2: Authenticated Communication with RSA The use of RSA for authentication of the sender is often referred to as applying a Digital Signature. A digitally signs the message by encrypting it with A s secret key.

4 RSA Public Key Encryption 4 Secret and Authenticated Communication with RSA To incorporate both secrecy and authentication, A encrypts the message twice, once using A s secret key, and once using B s public key, C = E Bp (E As (M)). B does the symmetrically opposite operations on the ciphertext: M = E Ap (E Bs (C)). Agent A A s B p Message M E ciphertext C E Figure 3: Secret and Authenticated Communication with RSA RSA Encryption Algorithm A pair of integers (e, n) is used in the encryption process, and another pair (d, n) is used to decrypt the message. The value of n is publicly known. We represent message M as an integer between 0 and n 1. If M is too large, it is broken up into blocks of the above size and each block is encrypted separately. If, for example, n has 128 bits, then any text message could be partitioned into blocks of 16 8 bit characters, and each block represented as an 128 bit binary number in base Then C = M e mod n To decrypt C, M = C d mod n ThenumbersofbitsinM and C are the same, C = M. Since e and d are large, more than 100 bits, the computations of M e and C d might appear to be problematic. Since the blocks of the message M will have the same number of bits as n, raisingm to a large power would appear to require a huge integer with tens of thousands of bits.

5 RSA Public Key Encryption 5 A result from number theory helps reduce the computational burden considerably: (a b) mod n =[(amodn) (bmodn)] mod n Where is one of {+,,. Therefore all the calculations and intermediate results need only be computed mod n, i.e. no more bits than in n. The (public) encryption key is the pair (e, n) and the (private) decryption key is the pair (d, n). Each agent has its own pair of keys. The value of n is the product of two large randomly chosen primes of size at least 100 decimal digits, n = pq Then d is chosen to be a large random integer that is coprime to (p 1)(q 1) and preferably larger than both p and q. Two integers a, b are coprime if their greatest common divisor is 1, GCD(a, b) =1. GCD(d, (p 1)(q 1)) = 1 Then e is computed from p, q, and d to be the multiplicative inverse of d, mod (p 1)(q 1): ed mod (p 1)(q 1) = 1 For the process to work, E (e,n) and E (d,n) must be inverse functions. Proof Euler s generalization of a theorem by Fermat states that for any integer M coprime to n, M φ(n) mod n =1 where φ(n) is the Euler totient function giving the number of positive integers less than n which are coprime to n. Forprimep, φ(p) =p 1; φ(n) =φ(pq) = φ(p)φ(q) =(p 1)(q 1).

6 RSA Public Key Encryption 6 The theorem implies that if e and d can be chosen such that, ed mod φ(n) =1 then M e mod n and M d mod n must be inverse functions. If M [0,n 1] we require that: (M e mod n) d mod n = M We start with: (M e mod n) d mod n = M ed mod n Now, ed mod φ(n) = 1 implies ed = kφ(n) + 1 for some integer k. Therefore M ed mod n = M kφ(n)+1 mod n = MM kφ(n) mod n = M(M kφ(n) mod n) mod n = M(1) mod n = M since M kφ(n) mod n =1 We have shown that, if ed mod φ(n) = 1 the encryption and decryption algorithms are inverses, as required. Now we show how to choose e and d. Yet another result from number theory states that, if e is coprime to φ(n), then d exists such that ed mod φ(n) =1. Any value coprime to φ(n) will do for d. T hen e is found by a modified Euclid s algorithm. See the code below. We would have to use much bigger integers than long ints in a practical version. See the use of the modinverse function from JAVA s BigInteger package on page??.

7 RSA Public Key Encryption 7 long int modinverse(long int d, longintφ(n)) { long int g 0 = φ(n), g 1 = d, u 0 =1,v 0 =0,u 1 =0,v 1 =1,i=1; while(g i 0){ // g i = u i φ(n)+v i d long int y = g i 1 /g i ; g i+1 = g i 1 y g i ; u i+1 = u i 1 y u i ; v i+1 = v i 1 y v i ; i ++; long int x = v i 1 ; if(x 0) return x; return x + φ(n); Simple Example: Set p =17,q= 23, therefore n = pq = 391, and (p 1)(q 1) = 352. Pick d to be coprime to 352. Any prime will work, but it is preferable that d>pand d>q. We will choose d = 37. Then solve 37emod352 = 1 to obtain e = 333. (Other pairs are d =29,e= 85, and d =13,e= 27). The RSA paper suggests: p and q should differ in length by a few digits, Both p 1andq 1 should have large prime factors, and GCD(p 1,q 1) should be small. Our example only satisfies the first of these. Larger Example: In a slightly larger example, p =47q = 59, n = 2773, and φ(n) =(p 1)(q 1) = If d = 157 then e = 17. We can encode two letters per block if we use the numeric conversion, blank = 00, A=01, B=02,...,Z=26. Then the message ITS ALL GREEK TO ME becomes

8 RSA Public Key Encryption 8 Now since the Binary representation of e is 10001, we can raise each block M to the power e by just 5 multiplications: M 17 = (((M 2 ) 2 ) 2 ) 2 M. In general, computing M e takes at most 2 log 2 (e) multiplications and 2log 2 (e) divisions. For the first block, mod 2773 = 948. The ciphertext is: To break the code, since n is known, it is necessary to factor n into p and q, but n is expected to be of the order of 200 decimal digits. The fastest known factoring algorithm at the time of publication of the RSA paper would require in excess of operations. With a computer operating at the rate of 10 9 operations per second, the factorization would take seconds, or years. Note that there are fast probabilistic algorithms to test if a given number is prime. See the algorithm by Solovay and Strassen on page??. Itis,however, much more difficult to find factors of a huge number, even when it is certain that the number has exactly two factors. Efficient Encryption Algorithm Computing M e modn requires at most 2log 2 (e) multiplies and 2log 2 (e) divides using the following method: Let e k e k 1 e 0 be the binary representation of e; C =1; for(i = k; i>=0;i ) { C =(C C) mod n; if(e i == 1) C =(C M) mod n; Repeated squaring is used. Consider computing M 11 mod n. The binary representation of 11 is C = 1 initially and after each of the 4 iterations its value is Mmodn, M 2 mod n, M 5 mod n, andm 11 mod n.

9 RSA Public Key Encryption 9 Here is the algorithm in JAVA using the BigInteger package: BigInteger encryptblock(biginteger m, BigInteger e) { BigInteger c = new BigInteger("1"); // c = 1 int k = e.bitlength(); // nmbr of bits in e for(int i=k;i>=0;i--) { c = c.multiply(c); // c *= c c = c.mod(n); // c %= n if(e.testbit(i)) { // bit 0 is lsb c = c.multiply(m); // c *= m c = c.mod(n); // c %= n return c; The BigInteger package provides integers of arbitrary length. They grow in size as determined by the calculations. Choosing the Primes Each user must choose two large primes, p, andq. Their product, n = pq will be public. If n is to be of the order of 200 decimal digits, then p and q must each have about 100 digits. The Prime Number Theorem states that about one number in every (ln10 s )/2 numbers will be prime for numbers of s decimal digits. For 100 digit numbers, approximately one number in every 115 will be prime. This result is rather surprising. There are a lot of prime numbers! The density of primes does reduce with the number of digits, but rather slowly. To test a number b for primality, Rivest et. al. recommend the following probabilistic algorithm due to Solovay and Strassen. Pick a random value a in the range {1 b 1 Test if GCD(a, b) = 1 AND J(a, b)=a (b 1)/2 mod b The first clause tests whether a is a factor of b. Ifitisnot,thenGCD(a,b) will be 1. The second clause uses the Jacobi function shown on page??. If b is prime, the test is always true. If b is not prime then the test will yield false with probability of 1/2.

10 RSA Public Key Encryption 10 If the test holds true for 100 randomly chosen values of a, thenb is prime with probability 1 1/ The Jacobi function returns a value in {-1,1. If it returns -1, then the test fails since a (b 1)/2 cannot be negative. If the Jacobi function returns 1, we compute a (b 1)/2 modb using the repeated squaring algorithm that is used for encryption on page??. Computation of J(a, b) using long ints: long int Jacobi(long int a, long int b) { if(a==1) return 1; if(a%2==0) { // if(a is even) if(((b*b-1)/8)%2==0) return Jacobi(a/2,b); return -Jacobi(a/2,b); if(((a-1)*(b-1)/4)%2==0) return Jacobi(b%a,a); return -Jacobi(b%a,a); The Jacobi function returns a value in {-1,1. We could not use long ints in a real implementation since b is likely to be of size 100 decimal digits. The Solovay and Strassen algorithm is, however, built into the JAVA BigInteger package. See page??.

11 RSA Public Key Encryption 11 Here we choose the keys in JAVA using the BigInteger package: Random r = new Random(); BigInteger p,q,n,d,e,phi; p = new BigInteger(size,certainty,r); // uses Solovay and q = new BigInteger(size,certainty,r); // Strassen, see below n = new BigInteger(p.multiply(q)); int blocklength = n.bitlength(); boolean notdone = true; while(notdone) { d = new BigInteger(blocklength/2+2,certainty,r); if(d.compareto(p)>0 && d.compareto(q)>0) notdone = false; phi = new BigInteger (p.subtract(one).multiply(q.subtract(one))); e = new BigInteger(d.modInverse(phi)); Random r = new Random(); is not part of the BigInteger package, but is essential to our needs. It creates a random number generator r. p = new BigInteger(size,certainty,r); creates a new BigInteger (p is a reference to it) with random value of up to size bits that is prime with probability at least 1 1/2 certainty. int blocklength = n.bitlength(); gives the number of bits in n. d = new BigInteger(blocklength/2+2,certainty,r); computes a random integer of up to blocklength/2+2 bits in length. The while loop ensures that d is larger than p and q. phi = new BigInteger(p.subtract(one).multiply(q.subtract(one))); computes phi =(p 1)(q 1). And in: e = new BigInteger(d.modInverse(phi)); the modinverse function calculates e such that e*d mod(phi) = 1

Overview. Public Key Algorithms I

Overview. Public Key Algorithms I Public Key Algorithms I Dr. Arjan Durresi Louisiana State University Baton Rouge, LA 70810 Durresi@csc.lsu.Edu These slides are available at: http://www.csc.lsu.edu/~durresi/csc4601-04/ Louisiana State

More information

Public Key Algorithms

Public Key Algorithms Public Key Algorithms CS 472 Spring 13 Lecture 6 Mohammad Almalag 2/19/2013 Public Key Algorithms - Introduction Public key algorithms are a motley crew, how? All hash algorithms do the same thing: Take

More information

Applied Cryptography and Computer Security CSE 664 Spring 2018

Applied Cryptography and Computer Security CSE 664 Spring 2018 Applied Cryptography and Computer Security Lecture 13: Public-Key Cryptography and RSA Department of Computer Science and Engineering University at Buffalo 1 Public-Key Cryptography What we already know

More information

Public Key Cryptography and RSA

Public Key Cryptography and RSA Public Key Cryptography and RSA Major topics Principles of public key cryptosystems The RSA algorithm The Security of RSA Motivations A public key system is asymmetric, there does not have to be an exchange

More information

RSA (material drawn from Avi Kak Lecture 12, Lecture Notes on "Computer and Network Security" Used in asymmetric crypto.

RSA (material drawn from Avi Kak Lecture 12, Lecture Notes on Computer and Network Security Used in asymmetric crypto. RSA (material drawn from Avi Kak (kak@purdue.edu) Lecture 12, Lecture Notes on "Computer and Network Security" Used in asymmetric crypto. protocols The RSA algorithm is based on the following property

More information

Public-key encipherment concept

Public-key encipherment concept Date: onday, October 21, 2002 Prof.: Dr Jean-Yves Chouinard Design of Secure Computer Systems CSI4138/CEG4394 Notes on Public Key Cryptography Public-key encipherment concept Each user in a secure communication

More information

Applied Cryptography and Network Security

Applied Cryptography and Network Security Applied Cryptography and Network Security William Garrison bill@cs.pitt.edu 6311 Sennott Square Lecture #8: RSA Didn t we learn about RSA last time? During the last lecture, we saw what RSA does and learned

More information

A nice outline of the RSA algorithm and implementation can be found at:

A nice outline of the RSA algorithm and implementation can be found at: Cryptography Lab: RSA Encryption and Decryption Lab Objectives: After this lab, the students should be able to Explain the simple concepts of encryption and decryption to protect information in transmission.

More information

Public Key Algorithms

Public Key Algorithms Public Key Algorithms 1 Public Key Algorithms It is necessary to know some number theory to really understand how and why public key algorithms work Most of the public key algorithms are based on modular

More information

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010 CS 494/594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010 1 Public Key Cryptography Modular Arithmetic RSA

More information

Public Key Cryptography and the RSA Cryptosystem

Public Key Cryptography and the RSA Cryptosystem Public Key Cryptography and the RSA Cryptosystem Two people, say Alice and Bob, would like to exchange secret messages; however, Eve is eavesdropping: One technique would be to use an encryption technique

More information

CS669 Network Security

CS669 Network Security UNIT II PUBLIC KEY ENCRYPTION Uniqueness Number Theory concepts Primality Modular Arithmetic Fermet & Euler Theorem Euclid Algorithm RSA Elliptic Curve Cryptography Diffie Hellman Key Exchange Uniqueness

More information

Assignment 9 / Cryptography

Assignment 9 / Cryptography Assignment 9 / Cryptography Michael Hauser March 2002 Tutor: Mr. Schmidt Course: M.Sc Distributed Systems Engineering Lecturer: Mr. Owens CONTENTS Contents 1 Introduction 3 2 Simple Ciphers 3 2.1 Vignère

More information

Cryptographic Techniques. Information Technologies for IPR Protections 2003/11/12 R107, CSIE Building

Cryptographic Techniques. Information Technologies for IPR Protections 2003/11/12 R107, CSIE Building Cryptographic Techniques Information Technologies for IPR Protections 2003/11/12 R107, CSIE Building Outline Data security Cryptography basics Cryptographic systems DES RSA C. H. HUANG IN CML 2 Cryptography

More information

What did we talk about last time? Public key cryptography A little number theory

What did we talk about last time? Public key cryptography A little number theory Week 4 - Friday What did we talk about last time? Public key cryptography A little number theory If p is prime and a is a positive integer not divisible by p, then: a p 1 1 (mod p) Assume a is positive

More information

Cryptography (DES+RSA) by Amit Konar Dept. of Math and CS, UMSL

Cryptography (DES+RSA) by Amit Konar Dept. of Math and CS, UMSL Cryptography (DES+RSA) by Amit Konar Dept. of Math and CS, UMSL Transpositional Ciphers-A Review Decryption 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 Encryption 1 2 3 4 5 6 7 8 A G O O D F R I E N D I S A T R E

More information

Public Key Encryption. Modified by: Dr. Ramzi Saifan

Public Key Encryption. Modified by: Dr. Ramzi Saifan Public Key Encryption Modified by: Dr. Ramzi Saifan Prime Numbers Prime numbers only have divisors of 1 and itself They cannot be written as a product of other numbers Prime numbers are central to number

More information

RSA (algorithm) History

RSA (algorithm) History RSA (algorithm) RSA is an algorithm for public-key cryptography that is based on the presumed difficulty of factoring large integers, the factoring problem. RSA stands for Ron Rivest, Adi Shamir and Leonard

More information

Chapter 3 Public Key Cryptography

Chapter 3 Public Key Cryptography Cryptography and Network Security Chapter 3 Public Key Cryptography Lectured by Nguyễn Đức Thái Outline Number theory overview Public key cryptography RSA algorithm 2 Prime Numbers A prime number is an

More information

CS Network Security. Nasir Memon Polytechnic University Module 7 Public Key Cryptography. RSA.

CS Network Security. Nasir Memon Polytechnic University Module 7 Public Key Cryptography. RSA. CS 393 - Network Security Nasir Memon Polytechnic University Module 7 Public Key Cryptography. RSA. Course Logistics Homework 2 revised. Due next Tuesday midnight. 2/26,28/02 Module 7 - Pubic Key Crypto

More information

Algorithms (III) Yijia Chen Shanghai Jiaotong University

Algorithms (III) Yijia Chen Shanghai Jiaotong University Algorithms (III) Yijia Chen Shanghai Jiaotong University Review of the Previous Lecture Factoring: Given a number N, express it as a product of its prime factors. Many security protocols are based on the

More information

Public Key Cryptography

Public Key Cryptography graphy CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L07, Steve/Courses/2011/S2/CSS322/Lectures/rsa.tex,

More information

Cryptography and Network Security. Sixth Edition by William Stallings

Cryptography and Network Security. Sixth Edition by William Stallings Cryptography and Network Security Sixth Edition by William Stallings Chapter 9 Public Key Cryptography and RSA Misconceptions Concerning Public-Key Encryption Public-key encryption is more secure from

More information

Algorithms (III) Yijia Chen Shanghai Jiaotong University

Algorithms (III) Yijia Chen Shanghai Jiaotong University Algorithms (III) Yijia Chen Shanghai Jiaotong University Review of the Previous Lecture Factoring: Given a number N, express it as a product of its prime factors. Many security protocols are based on the

More information

Chapter 9. Public Key Cryptography, RSA And Key Management

Chapter 9. Public Key Cryptography, RSA And Key Management Chapter 9 Public Key Cryptography, RSA And Key Management RSA by Rivest, Shamir & Adleman of MIT in 1977 The most widely used public-key cryptosystem is RSA. The difficulty of attacking RSA is based on

More information

Algorithms (III) Yu Yu. Shanghai Jiaotong University

Algorithms (III) Yu Yu. Shanghai Jiaotong University Algorithms (III) Yu Yu Shanghai Jiaotong University Review of the Previous Lecture Factoring: Given a number N, express it as a product of its prime factors. Many security protocols are based on the assumed

More information

Enhanced Asymmetric Public Key Cryptography based on Diffie-Hellman and RSA Algorithm

Enhanced Asymmetric Public Key Cryptography based on Diffie-Hellman and RSA Algorithm Enhanced Asymmetric Public Key Cryptography based on Diffie-Hellman and RSA Algorithm Princess Arleen S Zamora Gaduate Programs, Technological Institute of the Philippines Quezon City 1901, Philippines

More information

Cryptography III Want to make a billion dollars? Just factor this one number!

Cryptography III Want to make a billion dollars? Just factor this one number! Cryptography III Want to make a billion dollars? Just factor this one number! 3082010a0282010100a3d56cf0bf8418d66f400be31c3f22036ca9f5cf01ef614de2eb9a1cd74a0c344b5a20d5f80df9a23c89 10c354821aa693432a61bd265ca70f309d56535a679d68d7ab89f9d32c47c1182e8a14203c050afd5f1831e5550e8700e008f2

More information

An overview and Cryptographic Challenges of RSA Bhawana

An overview and Cryptographic Challenges of RSA Bhawana An overview and Cryptographic Challenges of RSA Bhawana Department of CSE, Shanti Devi Institute of Technology & Management, Israna, Haryana India ABSTRACT: With the introduction of the computer, the need

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 7 January 30, 2012 CPSC 467b, Lecture 7 1/44 Public-key cryptography RSA Factoring Assumption Computing with Big Numbers Fast Exponentiation

More information

ISA 662 Internet Security Protocols. Outline. Prime Numbers (I) Beauty of Mathematics. Division (II) Division (I)

ISA 662 Internet Security Protocols. Outline. Prime Numbers (I) Beauty of Mathematics. Division (II) Division (I) Outline ISA 662 Internet Security Protocols Some Math Essentials & History Asymmetric signatures and key exchange Asymmetric encryption Symmetric MACs Lecture 2 ISA 662 1 2 Beauty of Mathematics Demonstration

More information

Math From Scratch Lesson 22: The RSA Encryption Algorithm

Math From Scratch Lesson 22: The RSA Encryption Algorithm Math From Scratch Lesson 22: The RSA Encryption Algorithm W. Blaine Dowler January 2, 2012 Contents 1 What Is Encryption? 1 2 What Is RSA Encryption? 2 2.1 Key Generation............................ 2

More information

Admin ENCRYPTION. Admin. Encryption 10/29/15. Assignment 6. 4 more assignments: Midterm next Thursday. What is it and why do we need it?

Admin ENCRYPTION. Admin. Encryption 10/29/15. Assignment 6. 4 more assignments: Midterm next Thursday. What is it and why do we need it? Admin Assignment 6 4 more assignments:! Assignment 7, due 11/13 5pm! Assignment 8, due 11/20 5pm! Assignments 9 & 10, due 12/9 11:59pm ENCRYPTION David Kauchak CS52 Spring 2015 Admin Midterm next Thursday!

More information

Davenport University ITS Lunch and Learn February 2, 2012 Sneden Center Meeting Hall Presented by: Scott Radtke

Davenport University ITS Lunch and Learn February 2, 2012 Sneden Center Meeting Hall Presented by: Scott Radtke Davenport University ITS Lunch and Learn February 2, 2012 Sneden Center Meeting Hall Presented by: Scott Radtke A discussion on the mathematics behind coding and decoding using RSA Public-Key Cryptography.

More information

RSA: PUBLIC KEY ALGORITHMS

RSA: PUBLIC KEY ALGORITHMS Fernando Rosendo [fernando.rosendo@iweb.com.br] i.web Labs Brazil Theory and Implementation Public Key Algorithms based on mathematical properties which allow the cryptographic process (encryption) using

More information

Security in Distributed Systems. Network Security

Security in Distributed Systems. Network Security Security in Distributed Systems Introduction Cryptography Authentication Key exchange Readings: Tannenbaum, chapter 8 Ross/Kurose, Ch 7 (available online) Computer Science Lecture 22, page 1 Network Security

More information

Lecture 6: Overview of Public-Key Cryptography and RSA

Lecture 6: Overview of Public-Key Cryptography and RSA 1 Lecture 6: Overview of Public-Key Cryptography and RSA Yuan Xue In this lecture, we give an overview to the public-key cryptography, which is also referred to as asymmetric cryptography. We will first

More information

CSCI 454/554 Computer and Network Security. Topic 5.2 Public Key Cryptography

CSCI 454/554 Computer and Network Security. Topic 5.2 Public Key Cryptography CSCI 454/554 Computer and Network Security Topic 5.2 Public Key Cryptography Outline 1. Introduction 2. RSA 3. Diffie-Hellman Key Exchange 4. Digital Signature Standard 2 Introduction Public Key Cryptography

More information

Introduction to Cryptography and Security Mechanisms. Abdul Hameed

Introduction to Cryptography and Security Mechanisms. Abdul Hameed Introduction to Cryptography and Security Mechanisms Abdul Hameed http://informationtechnology.pk Before we start 3 Quiz 1 From a security perspective, rather than an efficiency perspective, which of the

More information

Great Theoretical Ideas in Computer Science. Lecture 27: Cryptography

Great Theoretical Ideas in Computer Science. Lecture 27: Cryptography 15-251 Great Theoretical Ideas in Computer Science Lecture 27: Cryptography What is cryptography about? Adversary Eavesdropper I will cut his throat I will cut his throat What is cryptography about? loru23n8uladjkfb!#@

More information

CSC 474/574 Information Systems Security

CSC 474/574 Information Systems Security CSC 474/574 Information Systems Security Topic 2.5 Public Key Algorithms CSC 474/574 Dr. Peng Ning 1 Public Key Algorithms Public key algorithms covered in this class RSA: encryption and digital signature

More information

Outline. CSCI 454/554 Computer and Network Security. Introduction. Topic 5.2 Public Key Cryptography. 1. Introduction 2. RSA

Outline. CSCI 454/554 Computer and Network Security. Introduction. Topic 5.2 Public Key Cryptography. 1. Introduction 2. RSA CSCI 454/554 Computer and Network Security Topic 5.2 Public Key Cryptography 1. Introduction 2. RSA Outline 3. Diffie-Hellman Key Exchange 4. Digital Signature Standard 2 Introduction Public Key Cryptography

More information

Public Key Algorithms

Public Key Algorithms CSE597B: Special Topics in Network and Systems Security Public Key Cryptography Instructor: Sencun Zhu The Pennsylvania State University Public Key Algorithms Public key algorithms RSA: encryption and

More information

Math236 Discrete Maths with Applications

Math236 Discrete Maths with Applications Math236 Discrete Maths with Applications P. Ittmann UKZN, Pietermaritzburg Semester 1, 2012 Ittmann (UKZN PMB) Math236 2012 1 / 33 Key size in RSA The security of the RSA system is dependent on the diculty

More information

RSA. Public Key CryptoSystem

RSA. Public Key CryptoSystem RSA Public Key CryptoSystem DIFFIE AND HELLMAN (76) NEW DIRECTIONS IN CRYPTOGRAPHY Split the Bob s secret key K to two parts: K E, to be used for encrypting messages to Bob. K D, to be used for decrypting

More information

Outline. Public Key Cryptography. Applications of Public Key Crypto. Applications (Cont d)

Outline. Public Key Cryptography. Applications of Public Key Crypto. Applications (Cont d) Outline AIT 682: Network and Systems Security 1. Introduction 2. RSA 3. Diffie-Hellman Key Exchange 4. Digital Signature Standard Topic 5.2 Public Key Cryptography Instructor: Dr. Kun Sun 2 Public Key

More information

CS Lab 11. Today's Objectives. Prime Number Generation Implement Diffie-Hellman Key Exchange Implement RSA Encryption

CS Lab 11. Today's Objectives. Prime Number Generation Implement Diffie-Hellman Key Exchange Implement RSA Encryption CS 105 - Lab 11 Today's Objectives Prime Number Generation Implement Dfie-Hellman Key Exchange Implement RSA Encryption Part 1: Dfie-Hellman Key Exchange In class you learned about the Dfie-Hellman-Merkle

More information

4 PKI Public Key Infrastructure

4 PKI Public Key Infrastructure 67 PKI 4.1 PKI history 4 PKI Public Key Infrastructure 4.1 PKI history Classical cryptography Example form II WW: Enigma dates back thousands of years symmetric key 68 PKI 4.1 PKI history Symmetric key

More information

A Tour of Classical and Modern Cryptography

A Tour of Classical and Modern Cryptography A Tour of Classical and Modern Cryptography Evan P. Dummit University of Rochester May 25, 2016 Outline Contents of this talk: Overview of cryptography (what cryptography is) Historical cryptography (how

More information

Chapter 9 Public Key Cryptography. WANG YANG

Chapter 9 Public Key Cryptography. WANG YANG Chapter 9 Public Key Cryptography WANG YANG wyang@njnet.edu.cn Content Introduction RSA Diffie-Hellman Key Exchange Introduction Public Key Cryptography plaintext encryption ciphertext decryption plaintext

More information

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

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 11 Basic Cryptography Security+ Guide to Network Security Fundamentals, Third Edition Chapter 11 Basic Cryptography Objectives Define cryptography Describe hashing List the basic symmetric cryptographic algorithms 2 Objectives

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Giuseppe F. Italiano Universita` di Roma Tor Vergata italiano@disp.uniroma2.it Motivation Until early 70s, cryptography was mostly owned by government and military Symmetric cryptography

More information

CS 161 Computer Security

CS 161 Computer Security Paxson Spring 2013 CS 161 Computer Security 3/14 Asymmetric cryptography Previously we saw symmetric-key cryptography, where Alice and Bob share a secret key K. However, symmetric-key cryptography can

More information

Cryptography. Cryptography is much more than. What is Cryptography, exactly? Why Cryptography? (cont d) Straight encoding and decoding

Cryptography. Cryptography is much more than. What is Cryptography, exactly? Why Cryptography? (cont d) Straight encoding and decoding Copyright 2000-2001, University of Washington Cryptography is much more than Cryptography Cryptography systems allow 2 parties to communicate securely. The intent is to give privacy, integrity and security

More information

Encryption Details COMP620

Encryption Details COMP620 Encryption Details COMP620 Encryption is a powerful defensive weapon for free people. It offers a technical guarantee of privacy, regardless of who is running the government It s hard to think of a more

More information

CS 6324: Information Security More Info on Key Establishment: RSA, DH & QKD

CS 6324: Information Security More Info on Key Establishment: RSA, DH & QKD ERIK JONSSON SCHOOL OF ENGINEERING & COMPUTER SCIENCE Cyber Security Research and Education Institute CS 6324: Information Security Dr. Junia Valente Department of Computer Science The University of Texas

More information

1.264 Lecture 28. Cryptography: Asymmetric keys

1.264 Lecture 28. Cryptography: Asymmetric keys 1.264 Lecture 28 Cryptography: Asymmetric keys Next class: Anderson chapters 20. Exercise due before class (Reading doesn t cover same topics as lecture) 1 Asymmetric or public key encryption Receiver

More information

Lecture 3 Algorithms with numbers (cont.)

Lecture 3 Algorithms with numbers (cont.) Advanced Algorithms Floriano Zini Free University of Bozen-Bolzano Faculty of Computer Science Academic Year 2013-2014 Lecture 3 Algorithms with numbers (cont.) 1 Modular arithmetic For cryptography it

More information

Cryptography Intro and RSA

Cryptography Intro and RSA Cryptography Intro and RSA Well, a gentle intro to cryptography, followed by a description of public key crypto and RSA. 1 Definition Cryptology is the study of secret writing Concerned with developing

More information

3/22/17. Admin. Assignment 6 ENCRYPTION. David Kauchak CS52 Spring Survey: How is the class going? Survey: respondents. 24 total respondents

3/22/17. Admin. Assignment 6 ENCRYPTION. David Kauchak CS52 Spring Survey: How is the class going? Survey: respondents. 24 total respondents Admin Assignment 6 ENCRYPTION David Kauchak CS52 Spring 2016 Survey: respondents Survey: How is the class going? 24 total respondents 1 Survey: How is the difficulty of the class? Survey: time spent per

More information

Primes and Codes. Dr Bill Lionheart, Department of Mathematics, UMIST. October 4, 2001

Primes and Codes. Dr Bill Lionheart, Department of Mathematics, UMIST. October 4, 2001 Primes and Codes Dr Bill Lionheart, Department of Mathematics, UMIST October 4, 2001 1 Introduction Codes have been used since ancient times to send secret messages. Today they are even more important.

More information

ASYMMETRIC CRYPTOGRAPHY

ASYMMETRIC CRYPTOGRAPHY ASYMMETRIC CRYPTOGRAPHY CONTENT: 1. Number Theory 2. One Way Function 3. Hash Function 4. Digital Signature 5. RSA (Rivest-Shamir Adleman) References: 1. Applied Cryptography, Bruce Schneier 2. Cryptography

More information

ICT 6541 Applied Cryptography. Hossen Asiful Mustafa

ICT 6541 Applied Cryptography. Hossen Asiful Mustafa ICT 6541 Applied Cryptography Hossen Asiful Mustafa Basic Communication Alice talking to Bob Alice Bob 2 Eavesdropping Eve listening the conversation Alice Bob 3 Secure Communication Eve listening the

More information

A Method for Obtaining Digital Signatures and Public-Key Cryptosystems

A Method for Obtaining Digital Signatures and Public-Key Cryptosystems Programming S.L. Graham, R.L. Rivest * Techniques Editors A Method for Obtaining Digital Signatures and Public-Key Cryptosystems R. L. Rivest, A. Shamir, and L. Adleman MIT Laboratory for Computer Science

More information

1 Extended Euclidean Algorithm

1 Extended Euclidean Algorithm CS 124 Section #8 RSA, Random Walks, Linear Programming 3/27/17 1 Extended Euclidean Algorithm Given a, b, find x, y such that ax + by = d where d is the GCD of a, b. This will be necessary in implementing

More information

Number Theory and RSA Public-Key Encryption

Number Theory and RSA Public-Key Encryption Number Theory and RSA Public-Key Encryption Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University E-mail: natarajan.meghanathan@jsums.edu CIA Triad: Three Fundamental

More information

Lecture 2 Applied Cryptography (Part 2)

Lecture 2 Applied Cryptography (Part 2) Lecture 2 Applied Cryptography (Part 2) Patrick P. C. Lee Tsinghua Summer Course 2010 2-1 Roadmap Number theory Public key cryptography RSA Diffie-Hellman DSA Certificates Tsinghua Summer Course 2010 2-2

More information

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption Introduction to Cryptography and Security Mechanisms: Unit 5 Public-Key Encryption Learning Outcomes Explain the basic principles behind public-key cryptography Recognise the fundamental problems that

More information

Lecture 30. Cryptography. Symmetric Key Cryptography. Key Exchange. Advanced Encryption Standard (AES) DES. Security April 11, 2005

Lecture 30. Cryptography. Symmetric Key Cryptography. Key Exchange. Advanced Encryption Standard (AES) DES. Security April 11, 2005 Lecture 30 Security April 11, 2005 Cryptography K A ciphertext Figure 7.3 goes here K B symmetric-key crypto: sender, receiver keys identical public-key crypto: encrypt key public, decrypt key secret Symmetric

More information

Computers and Security

Computers and Security The contents of this Supporting Material document have been prepared from the Eight units of study texts for the course M150: Date, Computing and Information, produced by The Open University, UK. Copyright

More information

Other Uses of Cryptography. Cryptography Goals. Basic Problem and Terminology. Other Uses of Cryptography. What Can Go Wrong? Why Do We Need a Key?

Other Uses of Cryptography. Cryptography Goals. Basic Problem and Terminology. Other Uses of Cryptography. What Can Go Wrong? Why Do We Need a Key? ryptography Goals Protect private communication in the public world and are shouting messages over a crowded room no one can understand what they are saying 1 Other Uses of ryptography Authentication should

More information

1 Extended Euclidean Algorithm

1 Extended Euclidean Algorithm CS 124 Section #8 RSA, Random Walks, Linear Programming 3/27/17 1 Extended Euclidean Algorithm Given a, b, find x, y such that ax + by = d where d is the GCD of a, b. This will be necessary in implementing

More information

Outline. Data Encryption Standard. Symmetric-Key Algorithms. Lecture 4

Outline. Data Encryption Standard. Symmetric-Key Algorithms. Lecture 4 EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 4 Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org Outline Review

More information

Key Exchange. Secure Software Systems

Key Exchange. Secure Software Systems 1 Key Exchange 2 Challenge Exchanging Keys &!"#h%&'() & & 1 2 6(6 1) 2 15! $ The more parties in communication, the more keys that need to be securely exchanged " # Do we have to use out-of-band methods?

More information

EEC-484/584 Computer Networks

EEC-484/584 Computer Networks EEC-484/584 Computer Networks Lecture 23 wenbing@ieee.org (Lecture notes are based on materials supplied by Dr. Louise Moser at UCSB and Prentice-Hall) Outline 2 Review of last lecture Introduction to

More information

Cryptography Lecture 4. Attacks against Block Ciphers Introduction to Public Key Cryptography. November 14, / 39

Cryptography Lecture 4. Attacks against Block Ciphers Introduction to Public Key Cryptography. November 14, / 39 Cryptography 2017 Lecture 4 Attacks against Block Ciphers Introduction to Public Key Cryptography November 14, 2017 1 / 39 What have seen? What are we discussing today? What is coming later? Lecture 3

More information

Distributed Systems. 26. Cryptographic Systems: An Introduction. Paul Krzyzanowski. Rutgers University. Fall 2015

Distributed Systems. 26. Cryptographic Systems: An Introduction. Paul Krzyzanowski. Rutgers University. Fall 2015 Distributed Systems 26. Cryptographic Systems: An Introduction Paul Krzyzanowski Rutgers University Fall 2015 1 Cryptography Security Cryptography may be a component of a secure system Adding cryptography

More information

Topics. Number Theory Review. Public Key Cryptography

Topics. Number Theory Review. Public Key Cryptography Public Key Cryptography Topics 1. Number Theory Review 2. Public Key Cryptography 3. One-Way Trapdoor Functions 4. Diffie-Helman Key Exchange 5. RSA Cipher 6. Modern Steganography Number Theory Review

More information

Keywords Security, Cryptanalysis, RSA algorithm, Timing Attack

Keywords Security, Cryptanalysis, RSA algorithm, Timing Attack Volume 4, Issue 1, January 2014 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com Performance

More information

Algorithmic number theory Cryptographic hardness assumptions. Table of contents

Algorithmic number theory Cryptographic hardness assumptions. Table of contents Algorithmic number theory Cryptographic hardness assumptions Foundations of Cryptography Computer Science Department Wellesley College Fall 2016 Table of contents Introduction Primes and Divisibility Modular

More information

Kurose & Ross, Chapters (5 th ed.)

Kurose & Ross, Chapters (5 th ed.) Kurose & Ross, Chapters 8.2-8.3 (5 th ed.) Slides adapted from: J. Kurose & K. Ross \ Computer Networking: A Top Down Approach (5 th ed.) Addison-Wesley, April 2009. Copyright 1996-2010, J.F Kurose and

More information

Some Stuff About Crypto

Some Stuff About Crypto Some Stuff About Crypto Adrian Frith Laboratory of Foundational Aspects of Computer Science Department of Mathematics and Applied Mathematics University of Cape Town This work is licensed under a Creative

More information

Channel Coding and Cryptography Part II: Introduction to Cryptography

Channel Coding and Cryptography Part II: Introduction to Cryptography Channel Coding and Cryptography Part II: Introduction to Cryptography Prof. Dr.-Ing. habil. Andreas Ahrens Communications Signal Processing Group, University of Technology, Business and Design Email: andreas.ahrens@hs-wismar.de

More information

- 0 - CryptoLib: Cryptography in Software John B. Lacy 1 Donald P. Mitchell 2 William M. Schell 3 AT&T Bell Laboratories ABSTRACT

- 0 - CryptoLib: Cryptography in Software John B. Lacy 1 Donald P. Mitchell 2 William M. Schell 3 AT&T Bell Laboratories ABSTRACT - 0 - CryptoLib: Cryptography in Software John B. Lacy 1 Donald P. Mitchell 2 William M. Schell 3 AT&T Bell Laboratories ABSTRACT With the capacity of communications channels increasing at the current

More information

Introduction. CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell

Introduction. CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell 1 Cryptography Merriam-Webster Online Dictionary: 1. secret writing 2. the enciphering and deciphering

More information

Quantum Encryption Keys

Quantum Encryption Keys Quantum Technology PROGRAMME ACTIVITY SHEETS Quantum Encryption Keys SHARING DECRYPTION KEYS AND DECODING MESSAGES Every time you send an email or you pay for something online, or with your debit card,

More information

Chapter 3. Cryptography. Information Security/System Security p. 33/617

Chapter 3. Cryptography. Information Security/System Security p. 33/617 Chapter 3 Cryptography Information Security/System Security p. 33/617 Introduction A very important tool for security is cryptography Cryptography is the (art and) science of keeping information secure

More information

RSA (Rivest Shamir Adleman) public key cryptosystem: Key generation: Pick two large prime Ô Õ ¾ numbers È.

RSA (Rivest Shamir Adleman) public key cryptosystem: Key generation: Pick two large prime Ô Õ ¾ numbers È. RSA (Rivest Shamir Adleman) public key cryptosystem: Key generation: Pick two large prime Ô Õ ¾ numbers È. Let Ò Ô Õ. Pick ¾ ½ ³ Òµ ½ so, that ³ Òµµ ½. Let ½ ÑÓ ³ Òµµ. Public key: Ò µ. Secret key Ò µ.

More information

Introduction to Cryptography. Vasil Slavov William Jewell College

Introduction to Cryptography. Vasil Slavov William Jewell College Introduction to Cryptography Vasil Slavov William Jewell College Crypto definitions Cryptography studies how to keep messages secure Cryptanalysis studies how to break ciphertext Cryptology branch of mathematics,

More information

Computer Networks. Network Security and Ethics. Week 14. College of Information Science and Engineering Ritsumeikan University

Computer Networks. Network Security and Ethics. Week 14. College of Information Science and Engineering Ritsumeikan University Computer Networks Network Security and Ethics Week 14 College of Information Science and Engineering Ritsumeikan University Security Intro for Admins l Network administrators can break security into two

More information

Recovery. Independent Checkpointing

Recovery. Independent Checkpointing Recovery Techniques thus far allow failure handling Recovery: operations that must be performed after a failure to recover to a correct state Techniques: Checkpointing: Periodically checkpoint state Upon

More information

A New Symmetric Key Algorithm for Modern Cryptography Rupesh Kumar 1 Sanjay Patel 2 Purushottam Patel 3 Rakesh Patel 4

A New Symmetric Key Algorithm for Modern Cryptography Rupesh Kumar 1 Sanjay Patel 2 Purushottam Patel 3 Rakesh Patel 4 IJSRD - International Journal for Scientific Research & Development Vol. 2, Issue 08, 2014 ISSN (online): 2321-0613 A New Symmetric Key Algorithm for Modern Cryptography Rupesh Kumar 1 Sanjay Patel 2 Purushottam

More information

Public Key Encryption

Public Key Encryption Public Key Encryption A case study THE RSA CRYPTOSYSTEM Public 31/05/14 Key Encryption 2 Rivest Shamir Adleman (1978) Key generation 1. Generate two large, distinct primes p, q (100 200 decimal digits)

More information

RSA (Rivest Shamir Adleman) public key cryptosystem: Key generation: Pick two large prime Ô Õ ¾ numbers È.

RSA (Rivest Shamir Adleman) public key cryptosystem: Key generation: Pick two large prime Ô Õ ¾ numbers È. RSA (Rivest Shamir Adleman) public key cryptosystem: Key generation: Pick two large prime Ô Õ ¾ numbers È. Let Ò Ô Õ. Pick ¾ ½ ³ Òµ ½ so, that ³ Òµµ ½. Let ½ ÑÓ ³ Òµµ. Public key: Ò µ. Secret key Ò µ.

More information

Cryptography: Matrices and Encryption

Cryptography: Matrices and Encryption Cryptography: Matrices and Encryption By: Joseph Pugliano and Brandon Sehestedt Abstract The focus of this project is investigating how to generate keys in order to encrypt words using Hill Cyphers. Other

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 8 September 22, 2014 CPSC 467, Lecture 8 1/59 Chaining Modes Block chaining modes Extending chaining modes to bytes Public-key Cryptography

More information

Cryptography. How to Protect Your Data

Cryptography. How to Protect Your Data Cryptography How to Protect Your Data Encryption is the act of changing information in such a way that only people who should be allowed to see the data are able to understand what the information is.

More information

*E. Madhusudhana Reddy & M.Padmavathamma Department of Computer Science, S.V.University, Tirupati

*E. Madhusudhana Reddy & M.Padmavathamma Department of Computer Science, S.V.University, Tirupati I.J.E.M.S., VOL. 1(1): 12-17 ISSN 2229-6X THRESHOLD MJ2 CRYPTOSYSTEM WITH ONE PUBLIC KEY AND ONE PRIVATE KEY *E. Madhusudhana Reddy & M.Padmavathamma Department of Computer Science, S.V.University, Tirupati

More information

Network Security. Chapter 4 Public Key Cryptography. Public Key Cryptography (4) Public Key Cryptography

Network Security. Chapter 4 Public Key Cryptography. Public Key Cryptography (4) Public Key Cryptography Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle Encryption/Decryption using Public Key Cryptography Network Security Chapter 4 Public Key Cryptography However,

More information

CSE 3461/5461: Introduction to Computer Networking and Internet Technologies. Network Security. Presentation L

CSE 3461/5461: Introduction to Computer Networking and Internet Technologies. Network Security. Presentation L CS 3461/5461: Introduction to Computer Networking and Internet Technologies Network Security Study: 21.1 21.5 Kannan Srinivasan 11-27-2012 Security Attacks, Services and Mechanisms Security Attack: Any

More information