PBKDF2 hash is not 32 bytes long on 64bit #34

tloris opened this Issue Apr 26, 2013 · 5 comments


None yet

3 participants

tloris commented Apr 26, 2013

I'm new to all of this; I usually just use the tools provided by awesome ppl like you, so I'm not sure how relevant this is.

As part of a project I am working on your library was included, and there was no problem on 32bit python2.7 version at work. But at home I'm using a 64bit one and I kept getting
"RuntimeError("The PBKDF2 hash is not 32 bytes long. The pycrypto library might be missing.")".
I looked around a bit and figured the problem was the hash was too long, not to short, so I shortened it. It works (apparently) flawlessly now. Since couple of ppl on the same project had this problem, and didn't find any solution on the internet, I thought I might mention this here.


Thank you for your bug report. I replicated the problem on a 64bit system, however I got an empty hash, not a longer one.


i'm seeing a similar problem, but in my case - the hash is empty ('').
any hints? (running on a macbook air 10.8.3)



not sure why, but uninstall and reinstall pycrypto seem to have fixed the problem


Empty hashes are due to a bug in Beaker - see patch in bbangert/beaker#42
The fact that reinstalling pycrypto fixes that could be due to Beaker packaging/installation issues.


@tloris - how long was the hash that you got? Was Cork running on Jython? Can you provide steps to reproduce it?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment