Crypto
crypto ¶
bi_sdk.crypto.aesgcm_decrypt ¶
bi_sdk.crypto.aesgcm_decrypt_hex ¶
bi_sdk.crypto.aesgcm_encrypt ¶
AESGCM encryptor function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key |
bytes
|
Encryption key |
required |
value |
bytes
|
Value to encrypt |
required |
nonce |
bytes
|
Optional nonce to use for encryption. If not provided, a random nonce will be generated. |
None
|
associated_data |
list[bytes]
|
Associated data to use for encryption |
None
|
Returns:
| Type | Description |
|---|---|
bytes
|
Nonce (bytes) + Encrypted value (bytes) |
bi_sdk.crypto.aesgcm_encrypt_hex ¶
Encrypt a value using AESGCM and return the result as a hex string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key |
bytes
|
Encryption key |
required |
value |
bytes
|
Value to encrypt |
required |
nonce |
bytes
|
Optional nonce to use for encryption. If not provided, a random nonce will be generated. |
None
|
associated_data |
bytes
|
Associated data to use for encryption |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Encrypted value (str) |