updated scripts

This commit is contained in:
Paul 2021-01-17 17:45:09 +01:00
parent 736d270364
commit 0b97450366

View File

@ -3,9 +3,11 @@
import argparse
import gnupg
KEYID = "salt"
GPGHOME = "/etc/salt/gpgkeys"
def parse_args():
parser = argparse.ArgumentParser(description='Encrypt password')
parser.add_argument('password', type=str, nargs=1,
@ -13,6 +15,7 @@ def parse_args():
args = parser.parse_args()
return args
def encrypt(password=""):
gpg = gnupg.GPG(gnupghome=GPGHOME, secret_keyring=KEYID)
encrypted_password = gpg.encrypt(password, KEYID)