#!/usr/bin/env python

import getpass
import argparse
import hashlib
from Crypto.Cipher import AES
from Crypto import Random

argparser = argparse.ArgumentParser(description="Generate password from passphrase")
argparser.add_argument('-l', dest="length", help="Generated password length", default=12)
argparser.add_argument('hint', nargs='*')
args = argparser.parse_args()

key = getpass.getpass()
len = int(args.length)
str = hashlib.sha512(key + args.hint[0]).hexdigest()[:len];

print (str)

@@ -390,16 +390,32 @@
 etpass()
+ + args.hint%5B0%5D;
 %0Alen = i
@@ -455,26 +455,32 @@
 512(
-key + args.hint%5B0%5D
+str(key).encode(%22utf-8%22)
 ).he

add required ut8 encoding