Skip to main content

A Python crypto and SSL toolkit

Project description

Maintainer:

Matěj Cepl

Web-Site:

https://sr.ht/~mcepl/m2crypto/

Documentation:

https://m2crypto.readthedocs.io/

IRC channel:

irc://irc.ergo.chat/#m2crypto

Issue tracker:

https://todo.sr.ht/~mcepl/m2crypto (R/O, please report issues via the email list).

M2Crypto = Python + OpenSSL + SWIG

builds.sr.ht status

NOTE: This library is currently in maintenance mode. We recommend using a more modern alternative such as PyCA/cryptography. Examples of how to migrate can be found in the documentation.

M2Crypto is a crypto and SSL toolkit for Python.

M2 stands for “me, too!”

M2Crypto comes with the following:

  • RSA, DSA, DH, HMACs, message digests, symmetric ciphers including AES,

  • TLS functionality to implement clients and servers.

  • Example SSL client and server programs, which are variously threading, forking or based on non-blocking socket IO.

  • HTTPS extensions to Python’s httplib, urllib and xmlrpclib.

  • Unforgeable HMAC’ing AuthCookies for web session management.

  • FTP/TLS client and server.

  • S/MIME v2.

  • ZSmime: An S/MIME messenger for Zope.

We care a lot about stable API and all Python methods should be preserved, note however that m2. namespace is considered internal to the library and it doesn’t have to be preserved. If however some change to it breaks your app, let us know and we will try to make things working for you.

  • And much more.

M2Crypto is released under a very liberal MIT licence. See LICENCE for details.

To install, see the file INSTALL.

Look at the tests and demos for example use. Recommended reading before deploying in production is “Network Security with OpenSSL” by John Viega, Matt Messier and Pravir Chandra, ISBN 059600270X.

Note these caveats:

  • Possible memory leaks, because some objects need to be freed on the Python side and other objects on the C side, and these may change between OpenSSL versions. (Multiple free’s lead to crashes very quickly, so these should be relatively rare.)

  • No memory locking/clearing for keys, passphrases, etc. because AFAIK Python does not provide the features needed. On the C (OpenSSL) side things are cleared when the Python objects are deleted.

Have fun! Your feedback is welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

m2crypto-0.46.0.tar.gz (500.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

m2crypto-0.46.0-cp313-cp313-win_amd64.whl (264.3 kB view details)

Uploaded CPython 3.13Windows x86-64

m2crypto-0.46.0-cp312-cp312-win_amd64.whl (264.3 kB view details)

Uploaded CPython 3.12Windows x86-64

m2crypto-0.46.0-cp312-cp312-win32.whl (209.0 kB view details)

Uploaded CPython 3.12Windows x86

m2crypto-0.46.0-cp311-cp311-win_amd64.whl (266.2 kB view details)

Uploaded CPython 3.11Windows x86-64

m2crypto-0.46.0-cp311-cp311-win32.whl (209.3 kB view details)

Uploaded CPython 3.11Windows x86

m2crypto-0.46.0-cp310-cp310-win_amd64.whl (265.0 kB view details)

Uploaded CPython 3.10Windows x86-64

m2crypto-0.46.0-cp310-cp310-win32.whl (209.2 kB view details)

Uploaded CPython 3.10Windows x86

File details

Details for the file m2crypto-0.46.0.tar.gz.

File metadata

  • Download URL: m2crypto-0.46.0.tar.gz
  • Upload date:
  • Size: 500.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0.tar.gz
Algorithm Hash digest
SHA256 5de32576c3bfc84fc2972ba703305dcba35dfb40383273e9552a7e17175dcb72
MD5 8f35e911bedaa043a0770c189df903ff
BLAKE2b-256 b6e79b7c2f9474479f1efa7d16878419dcd744513cadadc796ebf7320de3010f

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 264.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1cb671ac5a4a21b6049330f2cf1c4fb8dde1712b6638c4187c13f119b4349568
MD5 fb099b043ed80ca62be1a94485061b67
BLAKE2b-256 6f4b36d751ad7efd0df779e430926f957ab312367031185b3fade8722a12b5d3

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 264.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 15088b4040d7802c6ddb63be96a4015d5728ecad54c43ac47a4b321980d4023a
MD5 c63f10301d1e9ea57a4c41f721152097
BLAKE2b-256 f677af17f393a067ae67f62bc922939f615ecbea5c25c2d3474c586f2e7d42ea

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 209.0 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 c3ed672d2b6199540fbc7243a1fb0bde234658e79e2c240b07d51ab3fcf655ac
MD5 a918f6de5cafd3f7381c8b5cbcb5ad2a
BLAKE2b-256 ff076c4ec96932aa672bbeabd91944e5db9d7ae6464f83099b530db5fd3706aa

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 266.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 56681615e25395acabae190644ae27d70ac42390ccf967144fcfc04e412f0c1f
MD5 b7bf47379f43a63e6dd549165f59980d
BLAKE2b-256 dd83526a73aaeb4f6c8208fd1fd9a0ccc7e662b52372e9200e31c3060255096f

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 209.3 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 940bc909896e1bb5c43580cbce773ef8219730a37471fd17d41d62c00dce2f4f
MD5 3c98f4b634f444ecf028ca28fe4093bb
BLAKE2b-256 f9bfc9914a4468d4b7436cb46c2738849f40a3edd4721d27005759470223af47

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 265.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5b93bc4e9f24f820e8d5bb65e7a6ac8789edbbc85b068563c740c9b96f569223
MD5 3123b1c58ad867cf0ca3122219a0f6d6
BLAKE2b-256 f1cd9b20fc24c24aa44e94320eb1a84af967dbd7aa7dae89d23caef7de8e2c15

See more details on using hashes here.

File details

Details for the file m2crypto-0.46.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: m2crypto-0.46.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 209.2 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for m2crypto-0.46.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 0a22498e0f8bf43c41a0dc7a4b97f4d111630fa46e73972336c9ef3cbc4eb40e
MD5 8bb04779809ea9e6623fe82370ccf94d
BLAKE2b-256 9b8097494f052840bb5ad8ab587cf21cf4adb8b02e0319a6c8f54018111e452a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page