Skip to content
Snippets Groups Projects
Commit 244e2b1f authored by Sabine Schröder's avatar Sabine Schröder
Browse files

tool to create a password for a GUI user

parent af92b332
Branches devel
Tags
Loading
"""
create an encrypted password for a DestinE AQ (Core) User
=========================================================
- encrypt a given password with the Fernet key used in the DestinE AQ GUI
author:
s.schroeder@fz-juelich.de
date: 2024/02/27
call:
python create_user_password.py aWonderfulPassword
"""
__author__ = "Sabine Schroeder"
__version__ = "0.9"
__maintainer__ = "Sabine Schroeder"
__email__ = "s.schroeder@fz-juelich.de"
from cryptography.fernet import Fernet
from deployment_settings import KEY
import argparse
if __name__ == "__main__":
# get command line arguments
# instantiate the parser
parser = argparse.ArgumentParser(description='This app encrypts a given password with the Fernet key used in the DestinE AQ GUI')
# add arguments (required positional arguments)
parser.add_argument('password', type=str, help='password to be encrypted')
# parse the args
args = parser.parse_args()
# assign command line arguments
password = args.password
fernet = Fernet(KEY)
print(fernet.encrypt(password.encode()))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment