Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anybody show me (or point me to resource) how to generate public key and private key with simple math? Steps which can be reproduced in a simple calculator – so the message, keys all can be numbers for test. The values can be simple; it’s fine if it’s hackable. And how will you go about encrypting and decrypting the message with keys?

Let me know if you don't understand my question.

share|improve this question
RSA algorithm is explained pretty well at RSA Algorithm. It contains both example with small numbers (suitable for calculator) and large numbers. Even with simple numbers it's more convenient if you have advanced calculator as operations common in discrete mathematics are not found on simple calculators. However, RSA with insecurely small numbers is possible to calculate using mental arithmetic. – user4982 Jul 3 '14 at 18:55
See also Koblitz's "Kid RSA" (Example 3 here). – fkraiem Jul 3 '14 at 21:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.