472,353 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 4221
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Haim Ashkenazi | last post by:
Hi I'm trying to compile pycrypto on windows. I've installed mingw and try to run the command 'python setup.py build -c mingw32 install' and I...
28
by: Paul Rubin | last post by:
http://www.nightsong.com/phr/python/sharandom.c This is intended to be less predicable/have fewer correlations than the default Mersenne Twister...
4
by: Florian Lindner | last post by:
Hello, I try to compute SHA hashes for different files: for root, dirs, files in os.walk(sys.argv): for file in files: path = ...
11
by: dirvine | last post by:
Does anyone know if pycrypto is active at all. I have been browsing groups etc. for some info and have found entries from 2003 (latest) regarding...
2
by: Mike Meng | last post by:
Hi all, I'm learning Twisted and downloaded pyOpenSSL and pycrypto win32 installer on http://twisted.sourceforge.net/contrib/ . But I find the...
13
by: luca72 | last post by:
Hello I have to make an easy operation but reading the pycrypto doc. a never see AES example I have to cript this key...
5
by: EP | last post by:
This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ......
2
by: Ning | last post by:
I'm trying to write an IM client which sends encrypted messages to the server. I tried to use pycrypto library, but when I came to 3DES cypher I...
5
by: mirandacascade | last post by:
Attempting to determine whether the PyCrypto package has the capability to perform AES256 encryption. I received the following C# snippet: ...
0
by: yaipa | last post by:
I snipped this bit of code out of Andrew Kuchling 'pyCrypto' test fixture. Having a need to XOR Binascii Hex strings in my current project, I...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.