Crypt module

Wrapper to the POSIX crypt library call and associated functionality.

crypt.crypt(word, salt=None)[source]

Return a string representing the one-way hash of a password, with a salt prepended.

If salt is not specified or is None, the strongest available method will be selected and a salt generated. Otherwise, salt may be one of the crypt.METHOD_* values, or a string as returned by crypt.mksalt().

crypt.mksalt(method=None, *, rounds=None)[source]

Generate a salt for the specified method.

If not specified, the strongest available method will be used.