blob: 837a00e94aab14edd73afbdb73f7517c727ffe4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
In determining correctness, a major concern is determining that the message hasn't been tampered with by an intelligent intermediate.
Public key cryptography tries to answer this problem by providing proof of authorship and, as an extension of ``normal'' encryption, preventing interception.
RSA (Rivest-Shamir-Adleman, named after its MIT faculty creators) is one such algorithm.
It works by providing a set of public keys to all parties, and corresponding secret private keys.
One of the simpler algorithms, it applies the NP-hard nature of factorizing a semiprime, Euler’s theorem, and the Euclidean Algorithm to encrypt communication.
Because it is simple to devise, it has been included as a sample, in the form of a Python script which encrypts and decrypts messages, given a small RSA key (compared to those used in real applications).
There are several optimizations (such as applying the Chinese Remainder Theorem) which can be used, but none have been applied to maintain the code's simplicity.
\sinclude Methodology:rsa-method
|