Public Key Cryptography
Public key cryptography is a cryptographic scheme that uses two keys, a public key and a private key. It is used for signature, key exchange and etc.
The security is ensured by using the difficulty of the calculation. For example, given , it is easy to compute such that , but it is difficult to compute from .
RSA
RSA is a cryptosystem that relies on the difficulty of prime factorization. It is easy to compute the composite number for two primes , but it is difficult to compute the factors from .
Algorithm
This section explains the algorithm used to exchange messages securely using RSA. Let Alice be the receiver of the message and Bob be the sender.
Key Generation
Alice generates a key by doing the following:
- Choose two large prime numbers and compute .
- Choose a natural number such that .
- Find such that .
- Let be the public key and be the private key.
Encryption
Bob takes and the plaintext as inputs and find the ciphertext:
Decryption
Alice finds from and as follows.
Here , so we can recover the message.
Signature Algorithm
A signature can satisfy the authentication and non-repudiation requirements of security.
Authentication: Certificates that the signer is a valid signer.
Non-requdiation: The signer cannot deny the signature later.
Signature
Signed by: Alice, Received by: Bob
- Alice creates a public key and a private key .
- Alice computes the signature for the message and sends to Bob.
- Bob uses the received and the public key to verify that is true, and accepts if it is, or rejects otherwise.
From properties of the RSA cipher: