util Package¶
callback Module¶
Callback interface To be used when UI needs to be back to get info from user.
-
class
pwman.util.callback.CLICallback¶ Bases:
pwman.util.callback.Callback-
getinput(question)¶
-
getnewsecret(question)¶
-
getsecret(question)¶
-
config Module¶
-
class
pwman.util.config.Config(filename=None, defaults=None, **kwargs)¶ Bases:
object-
get_value(section, name)¶
-
save()¶
-
set_value(section, name, value)¶
-
-
exception
pwman.util.config.ConfigException(message)¶ Bases:
ExceptionBasic exception for config.
-
exception
pwman.util.config.ConfigNoConfigException(message)¶
-
pwman.util.config.get_pass_conf(config)¶
crypto_engine Module¶
-
class
pwman.util.crypto_engine.CryptoEngine(salt=None, digest=None, algorithm='AES', timeout=-1, reader=None)¶ Bases:
object-
authenticate(password)¶ salt and digest are stored in a file or a database
-
callback¶ return call back function
-
changepassword(reader=<built-in function input>)¶
-
decrypt(cipher_text)¶
-
encrypt(text)¶
-
forget()¶ discard cipher
-
classmethod
get(timeout=-1)¶
-
get_cryptedkey()¶ return _keycrypted
-
set_cryptedkey(key)¶
-
-
exception
pwman.util.crypto_engine.CryptoException¶ Bases:
Exception
-
pwman.util.crypto_engine.decode_AES(cipher, encoded_text)¶
-
pwman.util.crypto_engine.encode_AES(cipher, clear_text)¶
-
pwman.util.crypto_engine.generate_password(pass_len=8, uppercase=True, lowercase=True, digits=True, special_chars=True)¶
-
pwman.util.crypto_engine.get_cipher(password, salt)¶ Create a chiper object from a hashed password
-
pwman.util.crypto_engine.get_digest(password, salt)¶ Get a digest based on clear text password
-
pwman.util.crypto_engine.prepare_data(text, block_size)¶ prepare data before encryption so the lenght matches the expected lenght by the algorithm.
-
pwman.util.crypto_engine.zerome(string)¶ securely erase strings ... for windows: ctypes.cdll.msvcrt.memset