Jump to Navigation

Me on Twitter

  • RT @tewoz: Demain, lancement officiel de ma campagne de crowdfunding pour mon recueil de strips « Comme un Lundi » ! Je compte sur vous pou… 1 week 3 days ago
  • Found that in my old CD tower. Noticed the penguin ? Yes it's a #Linux version of #Tribes - Still one of the best g… https://t.co/4QEzHVXhmO 3 weeks 5 days ago
  • RT @esascience: In this #Hubble image, a very distant galaxy – nicknamed the Sunburst Arc – appears at least 12 times 4 weeks 5 days ago
  • The CIA just lost control of its hacking arsenal. Here’s what you need to know. - https://t.co/QrjTDlHJIA 5 weeks 2 days ago
  • RT @timberners_lee: Today the internet is 50 years old. The internet & the web it enabled have changed billions of lives for the better. B… 6 weeks 22 hours ago
  • Head-to-head evaluation of six password managers - Quantopian Security - Medium - https://t.co/WAiev023AJ 6 weeks 2 days ago
  • How I Fully Quit Google (And You Can, Too) - Featured Stories - Medium - https://t.co/d61000B5Fz 7 weeks 6 days ago
  • Just curious to see what happens if I publish a proof that's not been validated yet but another one has been since… https://t.co/tEjW1dOBZk 8 weeks 8 hours ago
  • Verifying myself: I am nicolabs on https://t.co/kWEo6pR64D. 8Q3_sZQCU_eT7R0adjPpzaxxehzySRwhjnWp / https://t.co/AIAa4UWCyX 8 weeks 8 hours ago
  • Verifying myself: I am nicolabs on https://t.co/kWEo6pR64D. SWkl7x3CLQ7yB21lfR5703KSVEq24aUwjKsG / https://t.co/aTGuWxSQzG 8 weeks 8 hours ago

Building PyCrypto for Win32

This article contains instructions to build PyCrypto 2.6 for Windows XP (32 bits).The PyCrypto library provides Python with implementation for a lot of algorithms for cryptography. It's very useful.

Ubuntu has it by default but if you want to have it for Python 3.2 on Windows, you must use Active Python, as there is no other binary release for Python 3.2 on the web.

In case you want to use the official Python distribution or if ActiveState did not (yet) released a PyCrypto for the version of Python you are using, this article might help you by putting together the steps to build it from source.

Also attached : a binary exe for the impatients.

Python logo

Building on Windows XP 32bits

First install Python if not already done : http://www.python.org/download/.

PyCrypto is an open source project so just get the package as well and unzip it : https://www.dlitz.net/software/pycrypto.

In order to fix a bug with distutils and the latest version of the compiler, edit <Python32_root>/Lib/distutils/cygwinccompiler.py by removing all occurrences of "-mno-cygwin" (this option has been removed in the latest versions).

Building PyCrypto requires a native compiler. By default it asks for Visual Studio but we will use MinGW :

In this console just type the following distutils command from the unzipped directory of PyCrypto :

python setup.py build --compiler=mingw32 install

And you're done : PyCrypto installed !

If you are just looking for the binary release, I've attached the installer for Win 32. This is probably not an optimized binary as the compilation produced the following message : "warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath"

Errors you might encounter

TypeError: unorderable types: NoneType() >= str()

gcc.exe is not in the PATH (http://bugs.python.org/issue8384). Use msys.bat or put all necessary tools in your PATH.

RuntimeError: chmod error

chmod.exe is not in the PATH (or MSYS is not installed)

IOError: Unable to find vcvarsall.bat

Visual Studio is not installed (http://bugs.python.org/issue2698). Use --compiler=mingw32.

References

AttachmentSize
pycrypto-2.6.win32-py3.2.exe662.6 KB

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>. The supported tag styles are: <foo>, [foo].
  • Twitter-style #hashtags are linked to search.twitter.com.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.