1993-10-07 - Re: RSA examples required

Header Data

From: Derek Atkins <warlord@MIT.EDU>
To: cypherpunks@toad.com
Message Hash: 70d60d4e2ed155bcc88da964bb34948d02ee5baafbff67d5e7e4eb6fac920324
Message ID: <9310070420.AA25310@marinara>
Reply To: N/A
UTC Datetime: 1993-10-07 04:25:25 UTC
Raw Date: Wed, 6 Oct 93 21:25:25 PDT

Raw message

From: Derek Atkins <warlord@MIT.EDU>
Date: Wed, 6 Oct 93 21:25:25 PDT
To: cypherpunks@toad.com
Subject: Re: RSA examples required
Message-ID: <9310070420.AA25310@marinara>
MIME-Version: 1.0
Content-Type: text/plain


Here is the response I sent to Peter Simons:

Well, your example that you sent isn't even correct!  Your example
said:

        p = 5    q = 7

        xy = 4*6+1 = 25         x=5
                                y=5

Well, you just chose some bad primes.  Here is a better example:

     p = 5   q = 11  N = pq = 55
     m = (p-1)(q-1) = 4*10 = 40

Now, we need to choose our public and private decryptors, E and d,
such that Ed = 1 mod (m):
     E = 3   d = 27

So, the Public Key (N, E) is (55, 3) and the Private (Secret)
Key (p, q, m, d) is (5, 11, 40, 27).  Now, to encrypt a message,
S, you take C = S^E mod N, and to decrypt you get S = C^d mod N.

So, say the message you want to send is, oh, "8" (for lack of a
better example off the top of my head).  So, you try to encrypt this
message, and you get:
     C = 8^3 mod 55 = 512 mod 55 = 17

You then send this message to the recipient, who then calculates
the message back:
     S = 17^27 mod 55 = 1667711322168688287513535727415473 mod 55 = 8

And you get the original message back.

-derek





Thread