Help on module crypt:
crypt β Wrapper to the POSIX crypt library call and associated functionality.
| Use Case | Command | Description |
|---|---|---|
| π Hash password with default salt | crypt.crypt(password) | Hash using strongest available method |
| π Hash password with specific method | crypt.crypt(password, crypt.METHOD_SHA512) | Hash using SHAβ512 |
| π§ Generate salt for default method | crypt.mksalt() | Generate salt for strongest method |
| π§ Generate salt for specific method | crypt.mksalt(crypt.METHOD_SHA256) | Generate salt for SHAβ256 |
| β Check password against hash | crypt.crypt(password, stored_hash) == stored_hash | Verify password |
https://docs.python.org/3.10/library/crypt.html
The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.
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().
Generate a salt for the specified method.
If not specified, the strongest available method will be used.
<crypt.METHOD_BLOWFISH><crypt.METHOD_CRYPT><crypt.METHOD_MD5><crypt.METHOD_SHA256><crypt.METHOD_SHA512>methods = [<crypt.METHOD_SHA512>, <crypt.METHOD_SHA256>, <crypt.METHOD.../usr/lib/python3.10/crypt.py
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-19 17:57 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format