home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky sci.math:15057 sci.math.num-analysis:3321
- Path: sparky!uunet!utcsri!torn!utzoo!dciem!jorchard
- From: jorchard@dciem.dciem.dnd.ca (Jeff Orchard)
- Newsgroups: sci.math,sci.math.num-analysis
- Subject: RSA Scheme for Encryption/Decryption
- Message-ID: <6633@dciem.dciem.dnd.ca>
- Date: 16 Nov 92 15:50:16 GMT
- Reply-To: jorchard@dretor.dciem.dnd.ca
- Followup-To: sci.math
- Organization: Defence and Civil Institute of Environmental Medicine
- Lines: 34
-
- I asked...
- >I would like to know the algorithm for encrypting/decrypting codes
- >with the RSA scheme.
-
- Here is what I was sent...
-
- From duvallp@hamlet.uncg.edu Wed Nov 11 19:37:52 1992
-
- You've probably gotten a zillion replies, but ....
-
- Choose two primes, p and q. Let M = pq, and F = phi(pq) = (p-1)(q-1).
- Choose a number e and let d be the solution to ed = 1 mod F. (You
- have to pick e relatively prime to F.) Publish M and e, keep p,q,F,
- and d secret. If x is the message, 0<x<M, I send y = x^e mod M to
- you. You then compute y^d mod M. Since x^F = 1 mod M by Fermat's
- little theorem, (actually Euler's refinement), you get
- y^d = x^ed = x^(kF + 1) = x mod M, and recover the message.
- There's a good treatment in "Elementary Number Theory and Its
- Applications," by K. Rosen, Addison Wesley. I also seem to remember a
- nice discussion in Knuth's "Art of Computer Programming, Vol.II,"
- but I don't have that in front of me.
- pd
-
-
- --
-
- Paul Duvall Department of Mathematics
- duvallp@hamlet.uncg.edu University of North Carolina
- duvallp@uncg.bitnet at Greensboro
- duvallp@mcduff.uncg.edu Greensboro, NC 27412
- (919) 334 5836
-
- Jeff Orchard jorchard@dretor.dciem.dnd.ca
- Dept. of National Defence, Toronto, Canada
-