[Python-checkins] python/dist/src/Doc/lib lib.tex, 1.239, 1.240 libhmac.tex, 1.1, 1.2 libmd5.tex, 1.21, 1.22 libsha.tex, 1.12, 1.13
greg@users.sourceforge.net
greg at users.sourceforge.net
Sun Aug 21 20:46:41 CEST 2005
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32064/Doc/lib
Modified Files:
lib.tex libhmac.tex libmd5.tex libsha.tex
Log Message:
[ sf.net patch # 1121611 ]
A new hashlib module to replace the md5 and sha modules. It adds
support for additional secure hashes such as SHA-256 and SHA-512. The
hashlib module uses OpenSSL for fast platform optimized
implementations of algorithms when available. The old md5 and sha
modules still exist as wrappers around hashlib to preserve backwards
compatibility.
Index: lib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v
retrieving revision 1.239
retrieving revision 1.240
diff -u -d -r1.239 -r1.240
--- lib.tex 18 Jun 2005 20:06:15 -0000 1.239
+++ lib.tex 21 Aug 2005 18:45:59 -0000 1.240
@@ -303,6 +303,7 @@
\input{libcrypto} % Cryptographic Services
\input{libhmac}
+\input{libhashlib}
\input{libmd5}
\input{libsha}
Index: libhmac.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhmac.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- libhmac.tex 11 Sep 2001 16:56:09 -0000 1.1
+++ libhmac.tex 21 Aug 2005 18:46:00 -0000 1.2
@@ -14,8 +14,10 @@
\begin{funcdesc}{new}{key\optional{, msg\optional{, digestmod}}}
Return a new hmac object. If \var{msg} is present, the method call
\code{update(\var{msg})} is made. \var{digestmod} is the digest
- module for the HMAC object to use. It defaults to the
- \refmodule{md5} module.
+ constructor or module for the HMAC object to use. It defaults to
+ the \code{\refmodule{hashlib}.md5} constructor. \note{The md5 hash
+ has known weaknesses but remains the default for backwards compatibility.
+ Choose a better one for your application.}
\end{funcdesc}
An HMAC object has the following methods:
@@ -29,14 +31,14 @@
\begin{methoddesc}[hmac]{digest}{}
Return the digest of the strings passed to the \method{update()}
- method so far. This is a 16-byte string (for \refmodule{md5}) or a
- 20-byte string (for \refmodule{sha}) which may contain non-\ASCII{}
- characters, including NUL bytes.
+ method so far. This string will be the same length as the
+ \var{digest_size} of the digest given to the constructor. It
+ may contain non-\ASCII{} characters, including NUL bytes.
\end{methoddesc}
\begin{methoddesc}[hmac]{hexdigest}{}
- Like \method{digest()} except the digest is returned as a string of
- length 32 for \refmodule{md5} (40 for \refmodule{sha}), containing
+ Like \method{digest()} except the digest is returned as a string
+ twice the length containing
only hexadecimal digits. This may be used to exchange the value
safely in email or other non-binary environments.
\end{methoddesc}
@@ -46,3 +48,7 @@
efficiently compute the digests of strings that share a common
initial substring.
\end{methoddesc}
+
+\begin{seealso}
+ \seemodule{hashlib}{The python module providing secure hash functions.}
+\end{seealso}
Index: libmd5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmd5.tex,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- libmd5.tex 2 Nov 2001 21:44:09 -0000 1.21
+++ libmd5.tex 21 Aug 2005 18:46:00 -0000 1.22
@@ -4,6 +4,7 @@
\declaremodule{builtin}{md5}
\modulesynopsis{RSA's MD5 message digest algorithm.}
+\deprecated{2.5}{Use the \refmodule{hashlib} module instead.}
This module implements the interface to RSA's MD5 message digest
\index{message digest, MD5}
Index: libsha.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsha.tex,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- libsha.tex 29 Jun 2004 13:35:01 -0000 1.12
+++ libsha.tex 21 Aug 2005 18:46:00 -0000 1.13
@@ -5,6 +5,8 @@
\modulesynopsis{NIST's secure hash algorithm, SHA.}
\sectionauthor{Fred L. Drake, Jr.}{fdrake at acm.org}
+\deprecated{2.5}{Use the \refmodule{hashlib} module instead.}
+
This module implements the interface to NIST's\index{NIST} secure hash
algorithm,\index{Secure Hash Algorithm} known as SHA-1. SHA-1 is an
More information about the Python-checkins
mailing list