RSA Algo Basics

## Setup

• Choose 2 Large Prime Numbers p and q
• $n = p \times q$(n is the modulus for both the public and private exponent)
• Compute Euler Totient $\Phi(n) = (p -1) \times (q -1)$

Euler's Totient Function $\Phi(n)$ is defined to be the number of positive integers less than or equal to n that are coprime to n

• Let Public Key $pubkey$ be some large number (Random Large Number)
• Private Key $prikey$ = $pubkey \times modInverse(\Phi(n))$

## Encrypt Message

• $message \times modPow(publicKey, n)$

## Decrypt Message

• $message \times modPow(privateKey, n)$
page revision: 16, last edited: 07 May 2009 14:49