RSA-OAEP (Optimal Asymmetric Encryption Padding)
RSA-OAEP is a widely used public key cryptography scheme to protect data confidentiality during transmission. Here's a detailed explanation of how it works:
1. Key Pair Generation
The process starts with the generation of an RSA key pair - a public key and a private key. The public key is shared to encrypt data, while the private key is kept secret and used to decrypt data.
2. Optimized Padding
Before encryption, RSA-OAEP applies optimized padding to the message. This padding enhances the security of encryption, making it harder for an attacker to deduce information about the original message.
3. Encryption
The message, after padding, is then encrypted using the RSA public key. The RSA algorithm ensures that only the corresponding private key can successfully decrypt the data.
4. Decryption
To decrypt the data, the recipient uses the private key corresponding to the public key used in encryption. The padding is removed, and the original message is retrieved.
5. SHA1 or SHA256
By default, the RSA-OAEP algorithm uses the SHA1 or SHA256 message digest algorithm to compute a message digest as part of the encryption operation. This adds an extra layer of security to the encrypted data.