Some RSA related calculations
Math 202 Cryptography
October 5, 2018

T. Ratliff, Wheaton College
ratliff_thomas@wheatoncollege.edu

Example from September 28: (Subscript[k, pub])=(25021, 3) (Subscript[k, pr])=(16467)

n=25021
FactorInteger[n]

phi=130*190
GCD[3,phi]

ExtendedGCD[3,phi]

Some real values for RSA: n=pq where p, q are 1024-bit primes

p=RandomPrime[{2^1023,2^1024-1}]
q=RandomPrime[{2^1023,2^1024-1}]
n=p*q
phi=(p-1)*(q-1)

GCD[3,phi]

GCD[5,phi]

GCD[7,phi]

ExtendedGCD[7,phi]