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.49.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.49.0
File Size Uploaded Provenance Actions
m2crypto-0.49.0.tar.gz 534.3 kB With provenance Details for m2crypto-0.49.0.tar.gz

Built distributions (wheels)

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

Total release size: 1.9 MB

Release files / m2crypto-0.49.0.tar.gz

Download URL m2crypto-0.49.0.tar.gz
Size 534.3 kB
Tags Source
SHA-256 checksum
How to use checksums
604b9cdd7c1bb9e73e54a189643d56d08bf841691775122962430ee2ca3506fe
BLAKE2b-256 checksum
How to use checksums
d642b1b6d202f66335ed80f10eae23eb0f9a69f9dd77783aa248892f44c91e66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

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 Aug 15, 2026.

Transparency log

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

Download URL m2crypto-0.49.0-cp314-cp314-win_amd64.whl
Size 284.5 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
0fe7d6173f3baccd169bce0b902364a43ae8f8f5a7ef7a3e59f0d9884e39e58c
BLAKE2b-256 checksum
How to use checksums
2b93ac0d0dac141628507b02158525e7471cabf6b3dc3cb9f6cfc7a46237fd19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

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 Aug 15, 2026.

Transparency log

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

Download URL m2crypto-0.49.0-cp313-cp313-win_amd64.whl
Size 277.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
11403e210b59afd6a7490e307bceff0c43fb45b83ab0a9a89a6397efa8c0638c
BLAKE2b-256 checksum
How to use checksums
4e910a9814b01c68e4b18a041d39271a7ce3867a6c4b67e111ed84cba43f9abf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

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 Aug 15, 2026.

Transparency log

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

Download URL m2crypto-0.49.0-cp312-cp312-win_amd64.whl
Size 277.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6df63c1cbdda7460475eddd8fc8d66f2c815c2722b631baa5e8d02453aa36bf5
BLAKE2b-256 checksum
How to use checksums
d16dc7f5ff39ce005378f50e81de645c08f30822f0faabae7f931a86120e95d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

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 Aug 15, 2026.

Transparency log

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

Download URL m2crypto-0.49.0-cp311-cp311-win_amd64.whl
Size 278.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
ebfc2155417a4df95867cffed001e736a135f4a210bbae7275ff4436b3a66bae
BLAKE2b-256 checksum
How to use checksums
c7e6655fa8db8c55ad8b10a23fe09a713054a7a8e858dc6d0a9676a404f90371
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

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 Aug 15, 2026.

Transparency log

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

Download URL m2crypto-0.49.0-cp310-cp310-win_amd64.whl
Size 278.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
787a13c347170e279358a0c3a06af1a86499c07a2def7786013577a0149eb293
BLAKE2b-256 checksum
How to use checksums
5c65eadfb80bb40e81444f164f643a9ef5a1bf2bc9a76495c34ff212111b0ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

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 Aug 15, 2026.

Transparency log

Security for M2Crypto 0.49.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.49.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 Aug 15, 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.49.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