Skip to content

Commit

Permalink
isort and black format
Browse files Browse the repository at this point in the history
  • Loading branch information
debakarr committed Dec 21, 2023
1 parent c725120 commit b741ccb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/kisskh_downloader/helper/aes_cipher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from base64 import b64decode, b64encode
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes


class AESCipher:
def __init__(self, key, initialization_vector):
Expand All @@ -26,4 +28,4 @@ def encrypt(self, text):
padded_data = padder.update(text.encode("utf8")) + padder.finalize()
encryptor = cipher.encryptor()
encrypted = encryptor.update(padded_data) + encryptor.finalize()
return b64encode(encrypted).decode("utf8")
return b64encode(encrypted).decode("utf8")

0 comments on commit b741ccb

Please sign in to comment.