RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.

Slides:



Advertisements
Similar presentations
Public Key Cryptosystem
Advertisements

Data Security 1 El_Gamal Cryptography. Data Security2 Introduction El_Gamal is a public-key cryptosystem technique El_Gamal is a public-key cryptosystem.
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
Data encryption with big prime numbers
22C:19 Discrete Structures Integers and Modular Arithmetic
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Authentication and Digital Signatures CSCI 5857: Encoding and Encryption.
Great Theoretical Ideas in Computer Science.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Tuesday, 26 November Number-Theoretic Algorithms Chapter 31.
Foundations of Network and Computer Security J J ohn Black Lecture #13 Sep 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Diffie-Hellman Key Exchange
Codes, Ciphers, and Cryptography-RSA Encryption
Lecture 6: Public Key Cryptography
Asymmetric encryption. Asymmetric encryption, often called "public key" encryption, allows Alice to send Bob an encrypted message without a shared secret.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
CSE 311 Foundations of Computing I Lecture 12 Primes, GCD, Modular Inverse Spring
Elgamal Public Key Encryption CSCI 5857: Encoding and Encryption.
Introduction to Modular Arithmetic and Public Key Cryptography.
RSA Public Key Algorithm. RSA Algorithm history  Invented in 1977 at MIT  Named for Ron Rivest, Adi Shamir, and Len Adleman  Based on 2 keys, 1 public.
Great Theoretical Ideas in Computer Science.
RSA Ramki Thurimella.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
1 Applications of Number Theory CS 202 Epp section 10.4 Aaron Bloomfield.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Public-Key Cryptography CS110 Fall Conventional Encryption.
Implementing RSA Encryption in Java
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013.
MA/CSSE 473 Day 10 Primality testing summary Data Encryption RSA.
The RSA Algorithm. Content Review of Encryption RSA An RSA example.
Discrete Logarithm(s) (DLs) Fix a prime p. Let a, b be nonzero integers (mod p). The problem of finding x such that a x ≡ b (mod p) is called the discrete.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
RSA The algorithm was publicly described in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at MIT Partly used for PGP (Pretty Good Privacy) to encrypt.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
ENCRYPTION TAKE 2: PRACTICAL DETAILS David Kauchak CS52 – Spring 2015.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
CS Modular Division and RSA1 RSA Public Key Encryption To do RSA we need fast Modular Exponentiation and Primality generation which we have shown.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Implementation Issues for Public Key Algorithms
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
CSE 311: Foundations of Computing Fall 2013 Lecture 12: Primes, GCD, modular inverse.
Introduction to Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Data encryption with big prime numbers DANIEL FREEMAN, SLU.
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
Elgamal Public Key Encryption CSCI 5857: Encoding and Encryption.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
ECE454/599 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2012.
Public Key Cryptosystem In Symmetric or Private Key cryptosystems the encryption and decryption keys are either the same or can be easily found from each.
Breaking Cryptosystems Joshua Langford University of Texas at Tyler Fall 2007 Advisor: Dr. Ramona Ranalli Alger.
CS/COE 1501 Recitation RSA Encryption/Decryption Extended Euclidean Algorithm Digital Signatures.
Information and Computer Security CPIS 312 Lab 8 1 Asymmetric Key Algorithms RSA Algorithm TRIGUI Mohamed Salim.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Intro to Cryptography ICS 6D Sandy Irani. Cryptography Intro Alice wants to send a message to Bob so that even if Eve can see the transmitted information,
Public Key Cryptosystems - RSA
CS/COE 1501 Recitation RSA Encryption/Decryption
CSE 321 Discrete Structures
Presentation transcript:

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA

Public Key Encryption Bob wants to send Alice a super secret message. How? Alice generates 2 keys – a public encryption key and a private decryption key. Bob takes the encryption key, encodes the message, then sends it to Alice. Alice then can decrypt the message. No one else can decrypt the message.

RSA How hard to crack is this kind of encryption – let’s take an example: 94021

Four Problems At the core of RSA are four problems:  Modular Exponentiation – compute x n (mod P)  GCD  Multiplicative inverse: solve AX ≡ 1 (mod P) for X  Primality testing

The Algorithm The receiver chooses two large primes p and q.  p = 127, q = 211 Compute N = pq and N’ = (p-1)(q-1)  N = 26797, N’ = Choose some e > 1 s.t. gcd(e, N’) = 1  e = Compute d, the multiplicative inverse of e, mod N’  d = The receiver then destroys p, q, and N’. Transmit e and N, keep d a secret. Encrypting – sender computes M e (mod N) and sends. M is the message. Decrypting – compute R d (mod N)

Computing Modular Exponentiation Solution 0 – do what it says. Do the exponentiation, then mod it by P. Solution 1 – start with a result, multiply by X, then mod by P – keep going until we’ve done this N times. Solution 2 – observe that if N is even – x n = (x*x) n/2, if N is odd – x n = x * (x*x) n/2 public static long modpower(long x, long n, long p){ if (n == 0) return 1; long tmp = modpower((x*x) % p, n/2, p); if (n%2 != 0) tmp = (tmp*x) % p; return tmp; }

Computing GCD Solution 1 – Euclid’s Algorithm – efficient, recursive, and 2300 years old.  Subtract B from A continuously until A becomes less than B, then switch. Continue until B becomes 0. A is the gcd. Solution 2 – leverage modulus: public long gcd (long a, long b){ if (b == 0) return a; return gcd(b, a%b); }

Basically, given A and N, solve for X where AX % N == 1 % N How to solve – leverage GCD from before ! private long x, y; public void fullGCD(long a, long b){ long x1, y1; if (b == 0){ x = 1; y = 0; }else{ fullGCD(b, a % b); x1 = x; y1 = y; x = y1; y = x1 – (a/b) * y1; } } public long inverse(long a, long n){ fullGCD(a, n); return x>0 ? x : x + n; } Compute Multiplicative Inverse

Finally, Primality Testing Solution? Randomized Algorithm: Pick a random integer i from 2 to n-1 Compute gcd(i, n). If this is not 1, primality fails. Otherwise, repeat up to k times.