[PYTHON-CRYPTO] Hashing modules

Michael Ströder michael at STROEDER.COM
Sun Feb 11 11:37:18 CET 2001


Ng Pheng Siong wrote:
> 
> On Sat, Feb 10, 2001 at 07:15:16PM +0100, Michael Ströder wrote:
> > Andrew Kuchling wrote:
> > > >>> from Crypto.Hash import MD5
> > > >>> m = MD5.new()
> > > >>> m.update('abc')
> > > >>> m.digest()
> > > '\220\001P\230<\322O\260\326\226?@}(\341\177r'
> >
> > Slightly different:
> > >>> import Crypto
> > >>> md5 = Crypto.getInstance('MD5')
> > >>> md5.update('abc')
> > >>> md5.digest()
> > > '\220\001P\230<\322O\260\326\226?@}(\341\177r'
> 
> M2Crypto's:
> 
> >>> from M2Crypto.EVP import MessageDigest
> >>> md5 = MessageDigest('md5')
> >>> md5.update('abc')
> >>> md5.digest()
> '\220\001P\230<\322O\260\326\226?}(\341\177r'

So at least for a message digest function we almost agree on how it
should be done. :-)

Ciao, Michael.





More information about the python-crypto mailing list