Pre-compiled binaries for PyCrypto 2.6.1 (py27) on Win7

There is a “new” version of PyCrypto out, and I can’t find any simple way to install it on Windows.  This is hardly news, and usually the Michael Foord has ready made windows installers over at Voidspace. To be totally honest, there probably isn’t a great need for a 2.6.1 release for windows, since the reason for the release doesn’t seem to apply:

In versions prior to v2.6.1, Crypto.Random was insecure when using fork() in some cases. See the advisory for CVE-2013-1445 for more information. It is recommended that users upgrade to PyCrypto v2.6.1 or later.  (

My use case is that I’m developing on windows and releasing on linux, and I’d like the requirements.txt to stay as much in sync as possible.


  1. I’ve downloaded and used Visual C++ 2008 Express Edition
  2. I’ve used the 2.6.x branch of PyCrypto (*)
  3. The compiled versions do not include MPIR / GMP _fastmath
  4. The .whl file is created by converting the .exe installer.

You should probably not download crypto libs from some random guy with a website, so I’ve included my build log so you can roll your own by following my steps.  I’ve got gnuwin32 installed, so you’ll see the occasional *nix command.

To set up the correct msvc environment I started from the Visual Studio 2008 Command Prompt:


and then I created a virtualenv to make sure I started from a clean slate:

c:\tmp>virtualenv --python=c:\Python27\python.exe dev
Running virtualenv with interpreter c:\Python27\python.exe
New python executable in dev\Scripts\python.exe
Installing setuptools, pip...done.

c:\tmp>cd dev
(dev) c:\tmp\dev>

The rest is in the build log.

For the brave and impatient there are pre-compiled versions:

(dev) C:\work\github\pycrypto\dist>md5sum *
aa791ce84cc2713f468fcc759154f47f *pycrypto-2.6.1-cp27-none-win32.whl
1a8cec46705cc83fcd77d24b6c9d079c *pycrypto-2.6.1.win32-py2.7.exe
This entry was posted in Python. Bookmark the permalink.

2 Responses to Pre-compiled binaries for PyCrypto 2.6.1 (py27) on Win7

  1. Dominik says:


    These links don’t work
    aa791ce84cc2713f468fcc759154f47f *pycrypto-2.6.1-cp27-none-win32.whl
    1a8cec46705cc83fcd77d24b6c9d079c *pycrypto-2.6.1.win32-py2.7.exe

    Thanks for fixing that

  2. tb says:

    The links work for me (they’re shared through dropbox, so make sure you can get to first).

Leave a Reply

Your email address will not be published. Required fields are marked *