| Start |
|---|
| An example using a hybrid cryptosystem consisting of OAEP and GCM The following example encrypts data by using a hybrid cryptosystem (opens new window) consisting of AES GCM and OAEP, using their default parameter sizes and an AES key size of 128 bits. OAEP is less vulnerable to padding oracle attacks than PKCS#1 v1.5 padding. GCM is also protected against padding oracle attacks. Decryption can be performed by first retrieving the length of the encapsulated key and then by retrieving the encapsulated key. The encapsulated key can then be decrypted using the RSA private key that forms a key pair with the public key. After that the AES/GCM encrypted ciphertext can be decrypted to the original plaintext. The protocol consists of:
Notes:
So here's the example: Of course, encryption is not very useful without decryption. Note that this will return minimal information if decryption fails. |
Read Article
https://develop.horje.com/learn/1434/reference