python-aprmd5

Download
Version 0.2

python-aprmd5 is a Python extension written in C that wraps the MD5 routines of the Apache Portable Runtime (APR) Utility Library (libaprutil) and exposes them to the Python interpreter as the module aprmd5. The main purpose of writing python-aprmd5 in the first place has been to expose the function apr_md5_encode(), which generates salted crypt-style hashes using a version of the MD5 hash algorithm that was modified especially for the APR project.

The resulting hashes always start with the prefix characters "$apr1$" in order to distinguish them from the result of various other crypt() variants, which use other prefixes. For instance, for input "foo" and salt "mYJd83wW", apr_md5_encode() produces the hash "$apr1$mYJd83wW$IO.6aK3G0d4mHxcImhPX50".

Hashes like this are typically generated by the command line utility htpasswd, which is part of the Apache HTTP server project. The hashes encrypt user passwords that are used by the Apache HTTP server for basic user authentication.

For completeness sake, python-aprmd5 exposes not only apr_md5_encode() but most of the other functions of libaprutil's MD5 routines as well. Where those functions are concerned with the original, unmodified MD5 algorithm, this is mostly a duplication of effort as that algorithm can be easily obtained through the Python Standard Library module "hashlib". In fact I advise against using python-aprmd5 if you are interested in the original MD5 algorithm only.

Project status

As of version 0.2, I consider python-aprmd5 to be feature complete. Unless a change in libaprutil breaks python-aprmd5, it is therefore rather unlikely that there will ever be a version 0.3. Maintenance releases 0.2.x will occur only if bugs are detected, or if I can be motivated to fix the crappy build process.

License

python-aprmd5 is released under the GNU General Public License (GPLv3).

Installation instructions

The tar ball that can be downloaded further down has been created using the Distutils Python module. In the terminology of Distutils, the tar ball is a so-called "source distribution". Read the file INSTALL inside the tar ball for more details about how to build the project and use the resulting Python module.

Bugs and source code

If you want to report a bug, please email me directly. You may also hop over to the Bugzilla page to have a look at issues that have already been reported. Please note that although anonymous users may freely browse the bugs database, they may not enter new bugs, nor is it currently possible to register a new account.

The source code for python-aprmd5 is maintained in a Git repository. This is the web link to access the repository in your web browser. If you want to clone the repository, please use this URL: http://git.herzbube.ch/python-aprmd5.git.

Project links

The website of the Apache Portable Runtime project can be found here: http://apr.apache.org/.

libaprutil and Python versions

No formal tests for compatibility with certain versions of libaprutil have been performed. The earliest version that I have casually used on my system at home (a Mac OS X box) is libaprutil 0.9. Another version that I have used for casual testing on a Debian virtual box is libaprutil 1.3.5. As the interface of the MD5 routines has not changed for a long time, and even across major versions of libaprutil, it is reasonable to expect that python-aprmd5 will work with pretty much all versions of libaprutil.

python-aprmd5 implements both the 2.x and the 3.x versions of Python's C-API, so in theory it should work with all versions of Python 2.x and 3.x. In practice, no formal tests have been performed to verify this statement. The earliest version of Python that I have used to build python-aprmd5 with has been 2.5.1, and the latest version has been 3.1.1 (both on Mac OS X 10.5).

Dependencies

Obviously, python-aprmd5 depends on the presence of libaprutil. At compile time, both the headers and the library file must be present. At runtime, the library file is sufficient.

Download

Download v0.2: [Source distribution] [ChangeLog] [README]

Download v0.1: [Source distribution] [ChangeLog] [README]