sqrl.crypto module¶
-
class
sqrl.crypto.Ed25519(public_key, private_key, msg)[source]¶ Bases:
objectUtility class for signing and verifying ed25519 signatures.
More information about ed25519 can be found at http://ed25519.cr.yp.to/.
Parameters: - public_key (bytes) – Key used for verifying signature.
- private_key (bytes) – Key used for signing data.
- msg (bytes) – Binary data for which to generate the signature.
-
class
sqrl.crypto.HMAC(nut, data)[source]¶ Bases:
objectUtility class for generating and verifying HMAC signatures.
This class relies on Django’s built in
salted_hmac()to compute actual HMAC values by usingSECRET_KEYas key.Parameters: - nut (SQRLNut) – Nut from which necessary data is extracted to add a salt value
to the HMAC input data.
Currently only
models.SQRLNut.session_keyis used. - data (OrderedDict) – Dict for which to either compute or validate HMAC signature.
- nut (SQRLNut) – Nut from which necessary data is extracted to add a salt value
to the HMAC input data.
Currently only
-
sqrl.crypto.generate_randomness(bytes=32)[source]¶ Generate random sample of specified size
bytes.Parameters: bytes (int, optional) – Number of bytes to generate random sample Returns: Base64.encode()encoded random sampleReturn type: str