encryption_utils
Utility class for encryption-related operations.
Code Example
Module
class human_protocol_sdk.encryption.encryption_utils.EncryptionUtils
Bases: object
A utility class that provides additional encryption-related functionalities.
static encrypt(message, public_keys)
Encrypts a message using the recipient’s public keys.
Parameters:
message (
str
) – Message to encryptpublic_keys (
List
[str
]) – List of armored public keys of the recipients
Return type:
str
Returns: Armored and encrypted message
Example:
static get_signed_data(message)
Extracts the signed data from an armored signed message.
Parameters: message (
str
) – Armored messageReturn type:
str
Returns: Extracted signed data
Example:
static is_encrypted(message)
Checks whether a provided message is encrypted or not
Parameters: message (
str
) – Text to checkReturn type:
bool
Returns: True if the message is a PGP message, False otherwise
Example:
static verify(message, public_key)
Verifies the signature of a message using the corresponding public key.
Parameters:
message (
str
) – Armored message to verifypublic_key (
str
) – Armored public key
Return type:
bool
Returns: True if the signature is valid, False otherwise
Example:
Last updated