Paper and Pencil RSA (starring the extended Euclidean algorithm)

Jenn Janesko · 226K views · 2013 · 7:31

Open on YouTube

CryptographyMath & theory (other)tutorial

Why Stack Overflow recommends it

Stack Overflow users link it as a small, checkable RSA example when students hand-roll toy RSA and need to verify their totient and private key calculations.

Recommended by 0 people across 0 different months, 2015 to 2020.

What it is

A short worked example of generating RSA public and private keys by hand, using the extended Euclidean algorithm with back substitution to find the private exponent. Presented by Jenn Janesko with small numbers, and explicitly not meant for real encryption.

What people said

Cites Kvothe · 2015-04 · Stack Overflow · on “network security- cryptography”

Your value for q is not prime 52=2^2 * 13 . Therefore you cannot find d because the maths for calculating this relies upon the fact the both p and q are prime. I suggest working your way through the examples given here [LINK] Normally, I would hesitate to suggest a wikipedia link such as that, but I found it very useful as a preliminary source when doing a project on RSA as part of my degree. You will need to be quite competent at modular arithmetic to get to grips with how RSA works. If you want to understand how to find d you will need to learn to find the Modular multiplicative inverse - just google this, I didn't come across anything incorrect when doing so myself. Good luck. A worked ex

Cites Juan Camilo Guarin P · 2015-05 · Stack Overflow · on “RSA Simple example with Javascript?”

I know this may be kind of basic but I am having an exam on the next week and I wanted to test my knowledge of RSA. I have a very simple problem that I am working on to see the mechanics of RSA, and I want to test if I can encrypt and decrypt a message in my browser console. The RSA variables are: var p = 11 //the first prime number var q = 5 //the second prime number var m=72 // the message var n=55 // the RSA modulus, n = p*q var e=7 // so (e,n) are the public key var d=23 //so (d,n) are the private key var fi_of_n=40 //the totient, fi_of_n = (p-1)*(q-1) = 40 To encrypt, I am doing: var c = Math.pow(m,e)%n // m^e mod(n); c=8 I get c to be equals to 8 Then I want to decrypt, using d as foll

Cites Zachary Clark · 2020-03 · Stack Overflow · on “RSA Encryption: Why do different totient calculations lead to correct results for some examples and incorrect results for other examples?”

For a class project, I am creating a manual implementation of RSA encryption. It is not meant to be cryptographically secure, it is meant only as a proof of understanding. I have created a program that can generate valid key pairs, but I noticed that different calculations for the totient lead to correct answers for different online examples. For instance, p and q are prime numbers, calculating the totient as: lcm((p - 1), (q - 1)) gives the correct private key for this example [LINK] and "A very simple example of RSA encryption" [LINK] , but incorrect private keys for "A slightly less simple example of the RSA algorithm" [LINK] and the example in this video [this video] . While calculating the t