Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
37ead8f1
Commit
37ead8f1
authored
Jul 26, 2004
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #997668: Correct explanation of salts.
Will backport to 2.3.
parent
abba5c06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
Doc/lib/libcrypt.tex
Doc/lib/libcrypt.tex
+9
-1
No files found.
Doc/lib/libcrypt.tex
View file @
37ead8f1
...
...
@@ -17,6 +17,10 @@ the \UNIX{} man page for further details. Possible uses include
allowing Python scripts to accept typed passwords from the user, or
attempting to crack
\UNIX
{}
passwords with a dictionary.
Notice that the behavior of this module depends on the actual implementation
of the
\manpage
{
crypt
}{
3
}
\index
{
crypt(3)
}
routine in the running system.
Therefore, any extensions available on the current implementation will also
be available on this module.
\begin{funcdesc}
{
crypt
}{
word, salt
}
\var
{
word
}
will usually be a user's password as typed at a prompt or
in a graphical interface.
\var
{
salt
}
is usually a random
...
...
@@ -25,6 +29,10 @@ attempting to crack \UNIX{} passwords with a dictionary.
set
\regexp
{
[./a-zA-Z0-9]
}
. Returns the hashed password as a
string, which will be composed of characters from the same alphabet
as the salt (the first two characters represent the salt itself).
Since a few
\manpage
{
crypt
}{
3
}
\index
{
crypt(3)
}
extensions allow different
values, with different sizes in the
\var
{
salt
}
, it is recommended to use
the full crypted password as salt when checking for a password.
\end{funcdesc}
...
...
@@ -40,7 +48,7 @@ def login():
if cryptedpasswd == 'x' or cryptedpasswd == '*':
raise "Sorry, currently no support for shadow passwords"
cleartext = getpass.getpass()
return crypt.crypt(cleartext, cryptedpasswd
[:2]
) == cryptedpasswd
return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd
else:
return 1
\end{verbatim}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment