encrypt
This module handles encryption logic
decrypt(payload)
Decrypts the given payload using a Fernet key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
bytes
|
The encrypted data to be decrypted. Must be in bytes format. |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
The decrypted data in bytes format. |
Source code in merlin/common/security/encrypt.py
encrypt(payload)
Encrypts the given payload using a Fernet key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
bytes
|
The data to be encrypted. Must be in bytes format. |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
The encrypted data in bytes format. |
Source code in merlin/common/security/encrypt.py
init_key()
Initializes the Fernet key and stores it on disk.
This function is called on import to prevent race conditions later on, or at least drastically reduce the number of corner cases where they could appear.