473,288 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 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 4294
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 get this error: $ python setup.py build -c...
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 or Wichmann-Hill generators. Comments are...
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 = os.path.join(root, file) print path f = open(path) sha =...
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 some bits I was looking for in particular reference...
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 lastest version are for Python 2.3. I try to...
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 'ea523a664dabaa4476d31226a1e3bab0' with the AES. Can you help me for make it...
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 ... or about some error in my script. Any insight...
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 was confused about the keysize to use. In the...
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: CryptoProvider provider = new CryptoProvider();...
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 found it very helpful to cut down on a bit of code...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.