a mathmatical implementation of rsa encryption
the basic theory behind rsa encryption, one of the oldest and most widely used encryption schemes. first we'll look at a technique to 'scramble' and 'unscramble' some integers and then notice that because numbers can encode whatever data you like, this scrambling and uncrambling can be used to encrypt data. the 'scrambling' will be easy and anyone with a public key can do it. the unscrambling requires knowledge of how to factor a particular number.
scramble stage (usually called the encrption stage):
take two primes
take any integer
- encrypt the following numbers with the key
$(43 \cdot 59, 13)$ using the modular exponentation technique from last week (note: we're using small primes for examples here.
unscramble stage (usually called the decryption stage)
so, anyone can encrypt. to decrypt though, it seems like we need special knowledge of what the primes
we know that
- use the above point to prove that
by analyzing three cases by applying fermat's little theorem along with the chinese remainder theorem:
- assume that
$m$ is not divisible by$p$ or$q$ - assume that
$m$ is equal to$0$ - assume that
$m$ is divisible by exactly one of$p$ or$q$ , but not both
why are these case adequate?
-
find an inverse of
$13 \text{ modulo } (42)(58)$ and check that decryption works for the two numbers you encrypted earlier -
decrypt,
there are many ways to encode data as a sequence of integers. a simple way to encode text as a string of integers is to find the greatest number of consecutive
-
encode the word MATH as two integers between
$0$ and$43 \cdot 59$ . encrypt your message using the RSA scheme. -
what words have we been encoding from our earlier examples?
encryption stage
-
take 2 primes
$p$ &$q$ -
set
$n = qp$ -
pick some
$e \bot (p - 1)(q - 1)$ -
the pair (n, e) is the encryption key you can give this to anyone and they can encrypt data as follows:
1.1 take any integer
1.2. encrypt the following numbers with the key
rsa encryption