Skip to content

Commit

Permalink
Merge pull request #29 from UBC-MDS/28-add-key-as-encrypt_password-fu…
Browse files Browse the repository at this point in the history
…nction-input

Add key as encrypt_password input
  • Loading branch information
mishelly-h authored Jan 12, 2024
2 parents 14ac33c + 84dc0a4 commit 9551db0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/passwordler/encrypt_password.py
Original file line number Diff line number Diff line change
@@ -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.
"""

0 comments on commit 9551db0

Please sign in to comment.