Created
June 23, 2021 12:47
-
-
Save random-robbie/db6672ab413b9240c70066146f513ae0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from cryptography.fernet import Fernet | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-f", "--fernet", required=True,help="Fernet Key") | |
parser.add_argument("-v", "--val", required=True,help="Value to decode") | |
args = parser.parse_args() | |
KEY = args.fernet | |
VAL = bytes(args.val, 'utf-8') | |
def decrypt_message(encrypted_message,KEY): | |
""" | |
Decrypts an encrypted message | |
""" | |
f = Fernet(KEY) | |
decrypted_message = f.decrypt(encrypted_message) | |
print(decrypted_message.decode()) | |
if __name__ == "__main__": | |
decrypt_message(VAL,KEY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment