Open claudefalbriard opened 2 years ago
No, and this is intentional. That said, you can use the "plaintext" as a key to a symmetric cipher to achieve the desired effect.
@kpdemetriou in some cases , this is required to encrypt a custom message(plain_text) using public key , so there is no way to do that ? or should i implement it myself ?
The KEMs provided in this module are not meant to encrypt arbitrary plaintext directly. Rather, you can use plaintext_original
and plaintext_recovered
to key a symmetric cipher like AES to achieve bulk encryption of content.
@kpdemetriou then what about asymmetric ? what if i want to encrypt a message using public key such that could be decrypted only using private key ?
The KEMs provided in this module are not meant to encrypt arbitrary plaintext directly. Rather, you can use
plaintext_original
andplaintext_recovered
to key a symmetric cipher like AES to achieve bulk encryption of content.
Are you able to give an example of how this is done?
I would like to clarify a conceptual doubt regarding use of the "encrypt" function described in the sample section of "Key Encapsulation". The execution confirms successful execution of the "assert" command, confirming encrypt and decrypt operations. When validating the field named plaintext_original with a Python print command, I get a binary field which does not match any standard decode methods like: UTF-8, or ISO-8859-1. After calling the encrypt function, the plaintext_original gets unreadable, likely the field gets modified by the C language processing. Is there a way to set a value for plaintext_original and keep it unmodified and validate it at the end of the encode/decode process?