Island: Rename variable in KeyBasedEncryptor

This commit is contained in:
Shreya Malviya 2022-07-19 19:05:51 +05:30
parent 11aff1f7fe
commit a7b4bbbd52
1 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ class KeyBasedEncryptor(IEncryptor):
initialized. initialized.
""" """
self._formatted_key = base64.urlsafe_b64encode(key) self._formatted_key = base64.urlsafe_b64encode(key)
self._fernet_object = Fernet(self._formatted_key) self._fernet = Fernet(self._formatted_key)
def encrypt(self, plaintext: bytes) -> bytes: def encrypt(self, plaintext: bytes) -> bytes:
""" """
@ -34,7 +34,7 @@ class KeyBasedEncryptor(IEncryptor):
:return: Encrypted message :return: Encrypted message
:rtype: bytes :rtype: bytes
""" """
return self._fernet_object.encrypt(plaintext) return self._fernet.encrypt(plaintext)
def decrypt(self, ciphertext: bytes) -> bytes: def decrypt(self, ciphertext: bytes) -> bytes:
""" """
@ -43,4 +43,4 @@ class KeyBasedEncryptor(IEncryptor):
:return: Decrypted message :return: Decrypted message
:rtype: bytes :rtype: bytes
""" """
return self._fernet_object.decrypt(ciphertext) return self._fernet.decrypt(ciphertext)