encryption
Last updated
Last updated
This class allows signing, verifying, encrypting, and decrypting messages at all levels of escrow processing.
The algorithm includes the implementation of the multi-public key encryption in Python. Using the vanilla implementation Schnorr signatures for signature and for encryption. Learn .
Bases: object
A class that provides encryption and decryption functionality using PGP (Pretty Good Privacy).
Initializes an Encryption instance.
Parameters:
private_key_armored (str
) – Armored representation of the private key
passphrase (Optional
[str
]) – Passphrase to unlock the private key. Defaults to None.
Decrypts a message using the private key.
Parameters:
message (str
) – Armored message to decrypt
public_key (Optional
[str
]) – Armored public key used for signature verification. Defaults to None.
Return type: bytes
Returns: Decrypted message
Example:
Signs a message using the private key.
Parameters: message (Union
[str
, bytes
]) – Message to sign
Return type: str
Returns: Armored and signed message
Example:
Signs and encrypts a message using the private key and recipient’s public keys.
Parameters:
message (Union
[str
, bytes
]) – Message to sign and encrypt
public_keys (List
[str
]) – List of armored public keys of the recipients
Return type: str
Returns: Armored and signed/encrypted message
Example: