469,625 Members | 1,088 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

sha, PyCrypto, SHA-256

Operating system: Win XP
Vsn of Python: 2.4

Situation is this: Required to calcluate a message digest. The process
for calcluating the digest must use an SHA-256 algorithm.

Questions:
1) Is it correct that the sha module comes with python 2.4?
2) Is it correct that the sha module that ships with python 2.4 does
NOT have the SHA-256 capability as part of the module?
3) It looks like PyCrypto is a package that, among other things,
permits one to calculate a message digest using an SHA-256
algorithm...is that correct?
4) It looks like there are a couple couple possibilities available for
the download...either download the source code and run the setup which
(I'm assuming) compiles the various extension modules, or download the
pycrypto-2.0.1.win32-py2.4.zip which extracts out to a .exe; when one
runs the just-extracted .exe, it installs the stuff on one's
workstation. I'm leaning toward the second option because it seems
like most of the work has been done for me. A quick search on this
site didn't turn up anything that suggested there were problems with
running the installer. So, my question is this: are you aware of any
problems running the installer?
5) Besides PyCrypto, are there any other Python packages that permit
one to calculate a message digest using an SHA-256 algorithm?

Thank you.

Dec 16 '06 #1
3 4113
Am 16 Dec 2006 11:17:19 -0800
schrieb mi************@yahoo.com:
Operating system: Win XP
Vsn of Python: 2.4

Situation is this: Required to calcluate a message digest. The
process for calcluating the digest must use an SHA-256 algorithm.

Questions:
1) Is it correct that the sha module comes with python 2.4?
2) Is it correct that the sha module that ships with python 2.4 does
NOT have the SHA-256 capability as part of the module?
3) It looks like PyCrypto is a package that, among other things,
permits one to calculate a message digest using an SHA-256
algorithm...is that correct?
4) It looks like there are a couple couple possibilities available for
the download...either download the source code and run the setup which
(I'm assuming) compiles the various extension modules, or download the
pycrypto-2.0.1.win32-py2.4.zip which extracts out to a .exe; when one
runs the just-extracted .exe, it installs the stuff on one's
workstation. I'm leaning toward the second option because it seems
like most of the work has been done for me. A quick search on this
site didn't turn up anything that suggested there were problems with
running the installer. So, my question is this: are you aware of any
problems running the installer?
5) Besides PyCrypto, are there any other Python packages that permit
one to calculate a message digest using an SHA-256 algorithm?

Thank you.

Python 2.5 comes with SHA-256 in the hashlib module.
So you could install Python 2.5 instead of the PyCrypto module.
Dennis
Dec 16 '06 #2

Dennis Benzinger wrote:
>
Python 2.5 comes with SHA-256 in the hashlib module.
So you could install Python 2.5 instead of the PyCrypto module.
You can download the python2.5 hashlib module for use with python2.4

-MIke

Dec 18 '06 #3
On Dec 16, 2:17 pm, mirandacasc...@yahoo.com wrote:
Operating system: Win XP
Vsn of Python: 2.4

Situation is this: Required to calcluate a message digest. The process
for calcluating the digest must use an SHA-256 algorithm.

Questions:
1) Is it correct that the sha module comes with python 2.4?
2) Is it correct that the sha module that ships with python 2.4 does
NOT have the SHA-256 capability as part of the module?
3) It looks like PyCrypto is a package that, among other things,
permits one to calculate a message digest using an SHA-256
algorithm...is that correct?
4) It looks like there are a couple couple possibilities available for
the download...either download the source code and run the setup which
(I'm assuming) compiles the various extension modules, or download the
pycrypto-2.0.1.win32-py2.4.zip which extracts out to a .exe; when one
runs the just-extracted .exe, it installs the stuff on one's
workstation. I'm leaning toward the second option because it seems
like most of the work has been done for me. A quick search on this
site didn't turn up anything that suggested there were problems with
running the installer. So, my question is this: are you aware of any
problems running the installer?
5) Besides PyCrypto, are there any other Python packages that permit
one to calculate a message digest using an SHA-256 algorithm?

Thank you.

I have run that exact installer many many times and it works fine. to
use SHA-256 with pycrypto:
>>from Crypto.Hash import SHA256
sha = SHA256.new()
sha.update('message')
sha.hexdigest() # sha.digest gives the raw form
'ab530a13e45914982b79f9b7e3fba994cfd1f3fb22f71cea1 afbf02b460c6d1d'

cheers
tim

Dec 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Haim Ashkenazi | last post: by
28 posts views Thread by Paul Rubin | last post: by
4 posts views Thread by Florian Lindner | last post: by
11 posts views Thread by dirvine | last post: by
2 posts views Thread by Mike Meng | last post: by
13 posts views Thread by luca72 | last post: by
2 posts views Thread by Ning | last post: by
5 posts views Thread by mirandacascade | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.