Python3 interface to mcrypt library, only for CAST-256 (CAST6) algorithm, with ECB mode.

pip install cast6ecb==0.3.1


Build Status


This extension is aimed at helping people who still needs a binding to libmcrypt because they need to use CAST-256 (CAST6) algorithm, in ECB mode.

As far as I know (I may be wrong at this point, feel free to correct me if it's the case), none of the other python crypto libs (either semi-native like pycrypto or Cpython like openssl) still implement this algorithm. Even libsodium, which was chosen by the PHP community as a replacement for mcrypt in php72, does not implement it.

Since I needed to decrypt some specific things that were encrypted with this algo, using python3, I created this extension to achieve that very specific goal. It is focused on CAST-256-ECB because that was my need, and I hope this will be very temporary.

I strongly advise people to upgrade both the algorithm they use (CAST-256 to AES for example) and the underlying library too (libmcrypt to openssl or libsodium).

Build the extension

Build locally

$ python3 build

Run the tests:

$ python3 test

Push to pypi

First, check your $HOME/.pypirc:

username = <username>
password = <password>

I had trouble with quoted user/password and password containing a '%'.

Then, run:

$ python3 sdist bdist_wheel upload