Skip to main content

documentation: https://m2crypto.readthedocs.io/
email list: https://lists.sr.ht/~mcepl/m2crypto (subscribe via email)
discussion channel: matrix:r/m2crypto:ceplovi.cz
issue tracker: |-
https://todo.sr.ht/~mcepl/m2crypto (R/O, please
report issues via the email list).
maintainer: "Matěj Cepl"
web-Site: https://codeberg.org/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 (and it has been in it since 2014 and I don’t plan to stop maintaining it anytime soon). For new applications 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.

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.49.0.tar.gz (534.3 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.49.0-cp314-cp314-win_amd64.whl (284.5 kB view details)

Uploaded CPython 3.14Windows x86-64

m2crypto-0.49.0-cp313-cp313-win_amd64.whl (277.0 kB view details)

Uploaded CPython 3.13Windows x86-64

m2crypto-0.49.0-cp312-cp312-win_amd64.whl (277.0 kB view details)

Uploaded CPython 3.12Windows x86-64

m2crypto-0.49.0-cp311-cp311-win_amd64.whl (278.2 kB view details)

Uploaded CPython 3.11Windows x86-64

m2crypto-0.49.0-cp310-cp310-win_amd64.whl (278.0 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

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

File metadata

  • Download URL: m2crypto-0.49.0.tar.gz
  • Upload date:
  • Size: 534.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for m2crypto-0.49.0.tar.gz
Algorithm Hash digest
SHA256 604b9cdd7c1bb9e73e54a189643d56d08bf841691775122962430ee2ca3506fe
MD5 8275971d0815bb7aef54648d1a550d17
BLAKE2b-256 d642b1b6d202f66335ed80f10eae23eb0f9a69f9dd77783aa248892f44c91e66

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.49.0.tar.gz:

Publisher: .gitlab-ci.yml on m2crypto/m2crypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: m2crypto-0.49.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 284.5 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for m2crypto-0.49.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0fe7d6173f3baccd169bce0b902364a43ae8f8f5a7ef7a3e59f0d9884e39e58c
MD5 41331d8ebefa350ee832324cc45753e6
BLAKE2b-256 2b93ac0d0dac141628507b02158525e7471cabf6b3dc3cb9f6cfc7a46237fd19

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.49.0-cp314-cp314-win_amd64.whl:

Publisher: .gitlab-ci.yml on m2crypto/m2crypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: m2crypto-0.49.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 277.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for m2crypto-0.49.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 11403e210b59afd6a7490e307bceff0c43fb45b83ab0a9a89a6397efa8c0638c
MD5 cb35cb8e5ce66c7eaa25063f7d72d5d3
BLAKE2b-256 4e910a9814b01c68e4b18a041d39271a7ce3867a6c4b67e111ed84cba43f9abf

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.49.0-cp313-cp313-win_amd64.whl:

Publisher: .gitlab-ci.yml on m2crypto/m2crypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: m2crypto-0.49.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 277.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for m2crypto-0.49.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6df63c1cbdda7460475eddd8fc8d66f2c815c2722b631baa5e8d02453aa36bf5
MD5 9da706a726621ccd595a480204fec016
BLAKE2b-256 d16dc7f5ff39ce005378f50e81de645c08f30822f0faabae7f931a86120e95d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.49.0-cp312-cp312-win_amd64.whl:

Publisher: .gitlab-ci.yml on m2crypto/m2crypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: m2crypto-0.49.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 278.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for m2crypto-0.49.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ebfc2155417a4df95867cffed001e736a135f4a210bbae7275ff4436b3a66bae
MD5 450756b8bb8d7d3cbc237c2cc8022efa
BLAKE2b-256 c7e6655fa8db8c55ad8b10a23fe09a713054a7a8e858dc6d0a9676a404f90371

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.49.0-cp311-cp311-win_amd64.whl:

Publisher: .gitlab-ci.yml on m2crypto/m2crypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: m2crypto-0.49.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 278.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for m2crypto-0.49.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 787a13c347170e279358a0c3a06af1a86499c07a2def7786013577a0149eb293
MD5 9ac091188fbd7400158c090e178a4973
BLAKE2b-256 5c65eadfb80bb40e81444f164f643a9ef5a1bf2bc9a76495c34ff212111b0ec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.49.0-cp310-cp310-win_amd64.whl:

Publisher: .gitlab-ci.yml on m2crypto/m2crypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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