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.

Metadata

Release files for M2Crypto 0.48.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for M2Crypto 0.48.0
File Size Uploaded Provenance Actions
m2crypto-0.48.0.tar.gz 531.8 kB With provenance Details for m2crypto-0.48.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for M2Crypto 0.48.0
File Actions
m2crypto-0.48.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for m2crypto-0.48.0-cp314-cp314-win_amd64.whl
m2crypto-0.48.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for m2crypto-0.48.0-cp313-cp313-win_amd64.whl
m2crypto-0.48.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for m2crypto-0.48.0-cp312-cp312-win_amd64.whl
m2crypto-0.48.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for m2crypto-0.48.0-cp311-cp311-win_amd64.whl
m2crypto-0.48.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for m2crypto-0.48.0-cp310-cp310-win_amd64.whl

Total release size: 1.9 MB

Release files / m2crypto-0.48.0.tar.gz

Download URL m2crypto-0.48.0.tar.gz
Size 531.8 kB
Tags Source
SHA-256 checksum
How to use checksums
178e290f558ddf0379aaefd34c0a8ddb21f21502594e588f928dda85f1ad202b
BLAKE2b-256 checksum
How to use checksums
897a06ed5c66d63506bc77a7823d56e5e6b4ad3143f3fca2337c46d8b2c191f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

Release files / m2crypto-0.48.0-cp314-cp314-win_amd64.whl

Download URL m2crypto-0.48.0-cp314-cp314-win_amd64.whl
Size 281.4 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
14f6233f7d8d87435d1e360ec284f88bdb9c19da3b99ba95f291262e89a69db2
BLAKE2b-256 checksum
How to use checksums
87f66eae27244be85b2c015d914f7ebed416870563153af265da121299da8c36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

Release files / m2crypto-0.48.0-cp313-cp313-win_amd64.whl

Download URL m2crypto-0.48.0-cp313-cp313-win_amd64.whl
Size 274.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
074da24da3bbe27480e70a0f3de2f33464bad69316c7ccd626e457cc2fd21aef
BLAKE2b-256 checksum
How to use checksums
f09c065c488210c78b7f4fdee5f835f7ea1fe6cfbba14cc9fdb9fa40a4139f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

Release files / m2crypto-0.48.0-cp312-cp312-win_amd64.whl

Download URL m2crypto-0.48.0-cp312-cp312-win_amd64.whl
Size 274.2 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
70b2b342b123c7843d1e78e8c5bece3438d0875fbcb0c733f03e1db61f828a0c
BLAKE2b-256 checksum
How to use checksums
938263cb96cb07b8bf95f926467082e0d8f80733e08ab55bc5ad21f209106bd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

Release files / m2crypto-0.48.0-cp311-cp311-win_amd64.whl

Download URL m2crypto-0.48.0-cp311-cp311-win_amd64.whl
Size 275.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6c97ca74e0bc442927c3907da508af62aeee8dd19a55ef364b390a7515e27524
BLAKE2b-256 checksum
How to use checksums
bd5b5f3c7ff05258059696e4a48bb85106d742c65b8496267c1d4722687e823f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

Release files / m2crypto-0.48.0-cp310-cp310-win_amd64.whl

Download URL m2crypto-0.48.0-cp310-cp310-win_amd64.whl
Size 275.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
6eae43e9268037f7b660312c00b64f217ec21e40dd9234e9e609ec784eb9b3d1
BLAKE2b-256 checksum
How to use checksums
4db14580ff2c332ca5aa903a01836865802fd93327642f3b44f8ff5bcaa550f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

Security for M2Crypto 0.48.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for m2crypto-0.48.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on May 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.48.0 This release

6 release files Full provenance

0.13

0.11

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page