From 84dc0a4c5121b5290a9a3911364de98afcc055b3 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 12 Jan 2024 12:56:54 -0800 Subject: [PATCH] Add key as encrypt_password input --- src/passwordler/encrypt_password.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/passwordler/encrypt_password.py b/src/passwordler/encrypt_password.py index 4898a3c..828c70d 100644 --- a/src/passwordler/encrypt_password.py +++ b/src/passwordler/encrypt_password.py @@ -1,14 +1,12 @@ -def encrypt_password(raw_password: str, encrypt_algo: list = ['AES']) -> str: +def encrypt_password(raw_password: str, key: bytes, encrypt_algo: list = ['AES']) -> str: """ Encrypt a given password. - - This function encrypts a password using a specified encryption algorithm. Currently, it supports AES encryption. + This function encrypts a password using a specified encryption algorithm and key. Currently, it supports AES encryption. The function applies padding to the password to match the block size requirement of the encryption algorithm. - Parameters: raw_password (str): The password to be encrypted. + key (bytes): The encryption key to use. encrypt_algo (list): List of encryption algorithms to use. Default is ['AES']. - Returns: str: The encrypted password. """ \ No newline at end of file