(public_key, data)
| 82 | |
| 83 | |
| 84 | def encrypt_rsa_oaep(public_key, data): |
| 85 | ciphertext = public_key.encrypt( |
| 86 | data, |
| 87 | padding.OAEP( |
| 88 | mgf=padding.MGF1(algorithm=hashes.SHA1()), |
| 89 | algorithm=hashes.SHA1(), |
| 90 | label=None) |
| 91 | ) |
| 92 | return ciphertext |
| 93 | |
| 94 | |
| 95 | def encrypt_rsa15(public_key, data): |