i basically want to know what data type is the output of the function, uuid.uuid4() and how can i change strings to it.
I am using the function in the following code and what is really confusing me, is that the function len(enc_key.bytes) returns 16 for the else branch but when I enter the exact same thing into the tkSimpleDialog.askstring() of the if branch, it says the str object has no attribute 'bytes'. I was under the impression that uuid.uuid4() returns a string either way.
Also, i would appreciate it if you could say how i could convert the user input from tkSimpleDialog.askstring()
into a data structure that can be plugged into a DES encryption, because my main problem is that right now pyDES won't accept the user input of tkSimpleDialog.askstring() as a valid encryption key on grounds of it not being a 16 or 24 byte key.
Here is the code for reference:
- Code: Select all
_here = os.path.dirname(os.path.abspath(__file__))
filename = os.path.join(_here, 'checkfile.txt')
enc_key = tkSimpleDialog.askstring( "Enigma Password Manager", "Please enter your encryption key (with dashes).")
key = uuid.uuid4()
tkMessageBox.showinfo( "Enigma Password Manager", "Your unique encryption key has been copied to your clipboard. Please note it down:" + str(key))
enc_key = key