Skip to main content

A Python crypto and SSL toolkit

Project description

documentation: https://m2crypto.readthedocs.io/
email list: https://lists.sr.ht/~mcepl/m2crypto (subscribe via email)
IRC channel: irc://irc.ergo.chat/#m2crypto
issue tracker: |-
https://todo.sr.ht/~mcepl/m2crypto (R/O, please
report issues via the email list).
maintainer: "Matěj Cepl"
web-Site: https://sr.ht/~mcepl/m2crypto/

M2Crypto

M2Crypto = Python + OpenSSL + SWIG

:alt: builds.sr.ht status
:target: https://builds.sr.ht/~mcepl?

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 BSD-2-Clause licence. See LICENSES/BSD-2-Clause.txt 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.47.0.tar.gz (662.5 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.47.0-cp314-cp314-win_amd64.whl (287.2 kB view details)

Uploaded CPython 3.14Windows x86-64

m2crypto-0.47.0-cp313-cp313-win_amd64.whl (281.9 kB view details)

Uploaded CPython 3.13Windows x86-64

m2crypto-0.47.0-cp312-cp312-win_amd64.whl (282.0 kB view details)

Uploaded CPython 3.12Windows x86-64

m2crypto-0.47.0-cp311-cp311-win_amd64.whl (282.4 kB view details)

Uploaded CPython 3.11Windows x86-64

m2crypto-0.47.0-cp310-cp310-win_amd64.whl (282.2 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

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

File metadata

  • Download URL: m2crypto-0.47.0.tar.gz
  • Upload date:
  • Size: 662.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for m2crypto-0.47.0.tar.gz
Algorithm Hash digest
SHA256 9256300be1e0412be802aa1f827e0ce7f94deb1099b8ccdcfd9867a7f0f975bf
MD5 83de8ba50f29a0d164d177bf4924ba44
BLAKE2b-256 8b19409bcaf2820beb0cb6e52e807c6af3ac535edd494e599c7eceb01c6534c1

See more details on using hashes here.

File details

Details for the file m2crypto-0.47.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.47.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 287.2 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for m2crypto-0.47.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c92ab5a7748ea966db2ba10a197d320e5d9b6c6101455652488db06be51cd260
MD5 c5a800207ab228cac30e2713823670f0
BLAKE2b-256 44a59b9d8f345514d77f436aeb55249605a2ffd2cc3d46834f4ca95e41de5401

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2crypto-0.47.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 281.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for m2crypto-0.47.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c3583438fc90bd7eff56c19d7a4ba81542d9c0b93f2862e4e43165ac9ac5e610
MD5 eef72be5808c2ea395ea909044ba2180
BLAKE2b-256 94fe08a857352b8ac27104704dcc311e57ecd6b19733e61309a9db736fa6a3b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2crypto-0.47.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 282.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for m2crypto-0.47.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7b209f531320828d8a20c7745e30f0999b426776b3d036a5551f2fc5907fbf2e
MD5 347cc51f46207ef9e0f44cf9774a78db
BLAKE2b-256 8e557cc7ac58615e99dbcee151c637655fadd608434d0744d39571b21d624c1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2crypto-0.47.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 282.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for m2crypto-0.47.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b49984f69a01c686a66eb65b5deb4f1244706817e80fa37554ef9d8c506d93fa
MD5 db764e747a9e34e358258a1ca8d01770
BLAKE2b-256 7803b72c1fda7251ba4f3b1b15acaff88c4d4255aa97978aca4639c0f00a641f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2crypto-0.47.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 282.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for m2crypto-0.47.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 34d6354ec544a69ce465d767bdf145f0c3e24a850faae773694d629fb656c0d9
MD5 5480d96d82aacf194c986f4ccbc599ed
BLAKE2b-256 877b12ccb460e37e5bb6dfd40ade547698481eec148ecf112cae5bb66276ea71

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