mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-07-23 15:01:07 -04:00
Cleanup
This commit is contained in:
parent
76f86f782a
commit
7a596882a8
2 changed files with 7 additions and 4 deletions
|
@ -28,6 +28,9 @@ from RNS.Cryptography import PKCS7
|
|||
from RNS.Cryptography.AES import AES_128_CBC
|
||||
|
||||
class Fernet():
|
||||
FERNET_VERSION = 0x80
|
||||
FERNET_OVERHEAD = 57 # In bytes
|
||||
OPTIMISED_FERNET_OVERHEAD = 54 # In bytes
|
||||
|
||||
@staticmethod
|
||||
def generate_key():
|
||||
|
@ -71,7 +74,7 @@ class Fernet():
|
|||
)
|
||||
|
||||
signed_parts = b"\x80"+current_time.to_bytes(length=8, byteorder="big")+iv+ciphertext
|
||||
|
||||
|
||||
return signed_parts + HMAC.new(self._signing_key, signed_parts).digest()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue