Hashlib is a Python module that implements a common interface to many different secure hash and message digest algorithms.
Questions tagged [hashlib]
427 questions
0
votes
0 answers
static-python error on import hashlib
Using static-python
When I compile the binary (3.3.2 version), and run ./python, if I import hashlib, I am receiving this error:
:akiva@akiva-ThinkPad-X230:~/Programming/Projects/youtube-downloader/static/static-python$ ./python
Python 3.3.2+…

Anon
- 2,267
- 3
- 34
- 51
0
votes
2 answers
Issues with Python hashlib.sha256 (2.4.3)
So I have some code:
signature = hmac.new(
key=AWS_SECRET_ACCESS_KEY,
msg=string_to_sign,
digestmod=hashlib.sha256).digest()
That runs perfectly on my own computer (has python 2.6.1). However, when I run this code on my server (Python…

John Wilfer
- 15
- 2
- 5
0
votes
3 answers
Python hashlib MD5 digest of any UNC file always yields same hash
The below code shows that three files which are on a UNC share hosted on another machine have the same hash. It also shows that local files have different hashes. Why would this be? I feel that there is some UNC consideration that I don't know…

Shaun
- 445
- 4
- 15
0
votes
1 answer
Python md5 function has different output with same input
I am doing a homework: register() function stores username-md5(password) pairs instead of username-password pairs in dict, then login() function checks whether a pair of username and password is correct or not. But I have problem with the login() if…

Sissi
- 65
- 1
- 10
0
votes
2 answers
What is the complexity of the hash function sha1
As the size of my substring grows, how can I find the complexity of this section of code?
if size > 160:
sub = (hashlib.sha1(sub.encode('utf-8')).hexdigest())
I became curious when I noticed my program running as if the hash function executed…

12345678910111213
- 353
- 7
- 24
0
votes
1 answer
hashlib.pbkdf2_hmac not found on AWS CentOS instance
I am running a Python application on a standard AWS CentOS instance. When the code tries to call hashlib.pbkdf2_hmac it raises an AttributeError exception. The code is as below:
import hashlib, binascii
hashed_password =…

David Poxon
- 2,435
- 4
- 23
- 44
0
votes
0 answers
Trouble with Python Libraries Between Different Nodes
I am trying to run a python script on a linux box with a specific version of python and I'm having some trouble. Every time I try to run the script on the linux box I get the traceback pasted below. The box has an Isilon storage system mounted…

Greg
- 237
- 2
- 11
0
votes
1 answer
Python Recursive Hashlib
I'm having a problem for computing all checksums of all the files under the /bin/* directory.
I'm implementing a HIDS in Python, so i need to compute the checksums of each file and save it, say, in a list .... so my code here only returns the first…

Emiliano
- 357
- 2
- 8
- 21
0
votes
1 answer
Python ripemd160 error
I'm trying to use the inbuilt ripemd160 and md4 provided by Openssl to generate hash.
This is my code
import hashlib
c = input("Enter: ")
c = c.encode('utf-8')
h = hashlib.new('ripemd160')
d = h.update(c)
print(d.hexdigest())
But this give me an…

user3447822
- 25
- 1
- 5
0
votes
1 answer
Do different OS's affect the md5 checksum of a file in Python?
So I have a python script that uses the pyserial library to send a file over serial to another computer. I wrote some script to calculate the md5 checksum of the file before and after being sent over serial and I have encountered some…

user3117351
- 141
- 1
- 1
- 9
0
votes
0 answers
python 2.7 hashlib sha1 not found on ARM
I'm trying to use openssl in python that is cross compiled to run on ARM.
For some reason the sha hashing methods are not found.
In the python console, I type:
import hashlib
ERROR:root:code for hash sha1 was not found. Traceback (most recent call…

max
- 9,708
- 15
- 89
- 144
0
votes
3 answers
What's the fastest way to compare bits of a hash in Python3?
I'm looking to compare bits of a hash in Python3, as part of a Hashcash system.
So for instance, I want to know if the first N bits of a SHA256 hash are 0.
Right now, I'm doing this based on the hex version
if newhash.hexdigest()[0:4] ==…
user396243
0
votes
1 answer
Python: TypeError: an integer is required
I am trying to get the md5 checksum of some files and write them into a temp file.
import os
import hashlib
PID = str(os.getpid())
manifest = open('/temp/tmp/MANIFEST.'+ PID + '.tmp','w') #e.g. MANIFEST.48938.tmp
for elmt in files_input:
…

imagineerThat
- 5,293
- 7
- 42
- 78
0
votes
1 answer
Converting values in a list to their hashed forms (Python)
I currently have the following code:
from itertools import permutations
import hashlib
def hash_f(x):
h = hashlib.md5(x)
return int(h.hexdigest(),base=16)
value = raw_input("Enter a value: ")
possibleValues = 'a'
for p in…

dantdj
- 1,237
- 3
- 19
- 40
0
votes
1 answer
MD5 encryption using jython
I need to encrypt some data using hashlib encryption in Jython. The output of variable "output" is a set of junk characters "¦?ìîçoÅ"w2?¨?¼?6"
m=hashlib.md5()
m.update(unicode(input).encode('utf-8'))
output =…

viji1188
- 1
- 3