sqrl.crypto module¶
-
class
sqrl.crypto.
Ed25519
(public_key, private_key, msg)[source]¶ Bases:
object
Utility 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:
object
Utility class for generating and verifying HMAC signatures.
This class relies on Django’s built in
salted_hmac()
to compute actual HMAC values by usingSECRET_KEY
as 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_key
is 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