This function will generate an authenticator for the data (provides authentication and integrity).
Parameters: |
|
---|---|
Returns: | str – The generated authenticator in byte string. |
This function will generate an authenticator for the data using the given secret key and compare it to the given authenticator, in order to validate it. Use this function instead of performing the comparison yourself, because it avoids timing attacks.
Parameters: |
|
---|---|
Returns: | bool – True if the given authenticator matches the generated authenticator or False otherwise. |
Generates a key for use in the encrypt() and decrypt() functions.
Returns: | str – The generated key, in byte string. |
---|
Generates an authenticator key.
Returns: | str – The generated key, in byte string. |
---|
Use this function to generate an encryption key from a password.
Parameters: |
|
---|---|
Returns: | str – The generated encryption key, in byte string. |
Use this function to generate an authenticator key from a password.
Parameters: |
|
---|---|
Returns: | str – The generated authenticator key, in byte string. |
Use this function to encrypt data. Two keys must be provided, one to guarantee confidentiality and another to guarantee integrity.
Parameters: |
|
---|---|
Returns: | str – The encrypted data. |
Use this function to decrypt data that was encrypted using encrypt(). The same keys used to encrypt the data must be provided to decrypt it.
Parameters: |
|
---|---|
Returns: | dict – The decrypted data. |