partially homomorphic encryption –rsa · rsa link pick two prime number (p and q) p = 11, q = 3 n...

7
Partially Homomorphic Encryption – RSA Prof Bill Buchanan, The Cyber Academy http://asecuritysite.com

Upload: others

Post on 15-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

Partially Homomorphic Encryption – RSA

Prof Bill Buchanan, The Cyber Academyhttp://asecuritysite.com

Page 2: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

Homomorphic Encryption

Fully homomorphic: DGHV, BGV, NTRU, LWE Partially homomorphic: RSA, Pallier, ElGamal

Page 3: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

RSA

Link

Pick two prime number (P and Q)

P = 11, Q = 3

N = P x Q = 33

PHI = (P-1) x (Q-1) =20

Pick e so that it is relative prime to PHI

eg 3, 7, 9, etc.

Let e=3

(d x e) mod PHI = 1

(d x 3) mod PHI = 1

d = 7

Page 4: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

RSAE = Me mod NM = Ed mod N

So with M=4, e=3, d=7 and N=33

E = 43 mod 33 = D = 337 mod 33 =

Page 5: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

Homomorphic Encryption (Multiply)

Link

In RSA we can perform a multiplication

Cipher1 = V1e mod NCipher 2 = V2e mod N

Cipher1 x Cipher 2 = V1e x V2e mod N = (V1 x V2)e mod N

Page 6: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

Homomorphic Encryption (Division)

Link

In RSA we can perform a division

Cipher1 = V1e mod NCipher 2 = V2e mod N

Cipher1 Cipher 2 = V1e ÷ V2e mod N = (V1 ÷ V2)e mod N =(V1 x V2-1)e mod N Calculate inverse V2 (mod N) here

Page 7: Partially Homomorphic Encryption –RSA · RSA Link Pick two prime number (P and Q) P = 11, Q = 3 N = P x Q = 33 PHI=(P-1)x(Q-1)=20 Pick e so that it is relative prime to PHI eg3,

Partially Homomorphic Encryption – RSA

Prof Bill Buchanan, The Cyber Academyhttp://asecuritysite.com