RSA and El Gamal Public Key Encryption

Public Key Encryption (PKE):

Setting: A bank wants to communicate with its customers over the internet.

  1. It does not want to set up different keys for each customer, a lot of work.

  2. It does not want to risk a customers secret key being stolen or otherwise compromized.

It will be notationally convenient below to abbreviate MATHas $\QTR{Large}{e(s)}$ and MATHas $\QTR{Large}{e(s)}$ and MATHas $\QTR{Large}{d(c)}$ which is consistant with 1.


Methodology: The bank tells the world about $\QTR{Large}{e}$ and if a customer wants to communicate a message $\QTR{Large}{s}$,

the customer first computes $\QTR{Large}{e(s)}$ and then transmits $\QTR{Large}{e(s)}$ . The bank then "receives" the message by computing MATH ).

Issues:

  1. Knowing $\QTR{Large}{e\ }$, it should be hard to determine $\QTR{Large}{d}$.

  2. The message should still contain some private information, maybe an account number, so that a customer's account is not compromised.

Digital Signatures:

PKE can be used for two way secret communication, between bank $\QTR{Large}{A}$ and bank $\QTR{Large}{B}$, as follows:

Methodology: bank $\QTR{Large}{A\ }$wishes to send a secret message $\QTR{Large}{m}$, using it computes MATH and transmits it. To read the message bank $\QTR{Large}{B\ }$ computes MATH

Again, bank $\QTR{Large}{A}$ knows $\QTR{Large}{e_{B}}$ but not $\QTR{Large}{d_{B}}$ and bank $\QTR{Large}{B}$ knows $\QTR{Large}{e_{A}}$ but not $\QTR{Large}{d_{A}}$.

_________________________________________________________________________________

RSA ( Rivest-Shamir-Adleman) PKE:

Methodology: Our calculations are in $\QTR{Large}{Z\ \ }$unless noted as MATH.

Choose MATH where $\QTR{Large}{p}$ $\QTR{Large}{\neq }$ $\QTR{Large}{q}$ are primes and MATH

Choose $\QTR{Large}{c}$ such that MATH, and let MATH .

MATHfor some $\QTR{Large}{k}$ .

The key observation is that if MATHfor MATH then by the Fermat--Euler Theorem:

MATH

To allow anybody to securely transmit messages to you$\QTR{Large}{\ }$:$\QTR{Large}{\ }$

Tell the world $\QTR{Large}{c\ }$and $\QTR{Large}{n}$ . Assume somebody wants to send the message $\QTR{Large}{a\ \ }$to you privately, tell them to compute

MATH and transmit $\QTR{Large}{\ e.}$

To decode the message received:

Compute MATH

To break the code:

Since people know $\QTR{Large}{c\ }$and $\QTR{Large}{n}$ , they need to calculate $\QTR{Large}{d}$ , and to do that they need to calculate

MATH

In particular factor $\QTR{Large}{n}$ , which can be difficult.

Some additional Notes. from a course I taught a few years back.

An original example from Rivest, Shamir, Adleman(1978):

MATH

MATH

The Alphabet Encoding:

MATH

The Message:

ITS ALL GREEK TO ME

The Message encoded in blocks of 2(with padding the last $\QTR{Large}{00}$):

MATH

- - - - - -- - - - - -

Note: Encoding in blocks of 2 and then enciphering the block is a bit idiosyncratic. I chose to reproduce the original example.

What makes this work is that the biggest, thus encoded message (ZZ) ,considered as a number MATH

Of course, the price paid is that the deciphered message may have an extra blank at the end.

- - - - - - - - - - - - - - - - - -

IT :Enciphered

MATH

The Message Enciphered :

MATH

IT :Deciphered

MATH

MATH

MATH

MATH

Try it yourself:

Exercise(Due April 11 )

MATH

The Alphabet Encoding:

MATH

The Message:

CAB



Find an appropriate $\QTR{Large}{e}$ and$\QTR{Large}{\ d\ }$ then Encode MATHEncipher MATHDecipher the message.

________________________________________________________________________________

El Gamal PKE:

Definitions:

Given a prime, $\QTR{Large}{p}$ , we are looking at MATH, the multiplicative group of non-zero elements in MATH.

Methodology:

Given MATH a primitive root, choose a private key $\QTR{Large}{k}$.

To allow anybody to securely transmit messages to you$\QTR{Large}{\ }$:$\QTR{Large}{\ }$

Tell the world MATH and, MATH . Assume somebody wants to send the message $\QTR{Large}{a\ \ }$to you privately, tell them to select a private key $\QTR{Large}{l\ }$compute

MATH $\QTR{Large}{)}$and MATH , and transmit both values.

To decode the message received:

Compute MATH

To break the code:

Plan A: You know$\ \QTR{Large}{r}$ and, MATH just compute $\QTR{Large}{k}$.

Plan B: You know$\ \QTR{Large}{r}$ and, MATH just compute $\QTR{Large}{l\ }$and since you know MATHcompute MATHthen compute MATH

In both cases you need to be able to compute the discrete logarithm of a number. Again this is hard computationally.

______________________________________________________________________________________________________


Figure

This image is from Cryptography: Theory And Practice By Douglas Robert Stinson,

an excellent book for those who wish to pursue this subject further.