Skip to main content

Documentation Status SourceHut Mailing List Support Channel Issue Tracker

M2Crypto

M2Crypto = Python + OpenSSL + SWIG

Build Status

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.

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.51.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.51.0
File Size Uploaded
m2crypto-0.51.0.tar.gz 545.1 kB Details

Built distributions (wheels)

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

Total release size: 2.0 MB

Release files / m2crypto-0.51.0.tar.gz

Download URL m2crypto-0.51.0.tar.gz
Size 545.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5428f6601086a8f5e41aa70248b3b983443e7badf263551c5104ba2ec0c9d955
BLAKE2b-256 checksum
How to use checksums
5bd5282d1ebd36c248cd1e4010523191a1ff59156c438cea061247ce65e53f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

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 Oct 12, 2026.

Transparency log

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

Download URL m2crypto-0.51.0-cp314-cp314-win_amd64.whl
Size 290.9 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
d1b4bbdea949fd3ee641c7f86e9dfdc901327821df7b63788d1471a0c5a29f3c
BLAKE2b-256 checksum
How to use checksums
f18c3e285d24fe0edd213fdcf79e30b828374cedb48756c45900d691978ddfa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

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 Oct 12, 2026.

Transparency log

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

Download URL m2crypto-0.51.0-cp313-cp313-win_amd64.whl
Size 283.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
9f9c06f13c0f3b29a6987c0095601ff47e8286f5d40884fd58b4bc136092a2d0
BLAKE2b-256 checksum
How to use checksums
eb7bd8eeb95e3b8bfa344ed93a5b718bdf79de2a93d80675220c73dceb0790d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

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 Oct 12, 2026.

Transparency log

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

Download URL m2crypto-0.51.0-cp312-cp312-win_amd64.whl
Size 283.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
83042cc042e59b8bbd2c71f0f1fcaa13b703866458f5c04564772fc56f8c4131
BLAKE2b-256 checksum
How to use checksums
429aa4662ad2751572809f3d47f90944d0d58149d9424ad89c36f76445cef03c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

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 Oct 12, 2026.

Transparency log

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

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

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 Oct 12, 2026.

Transparency log

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

Download URL m2crypto-0.51.0-cp310-cp310-win_amd64.whl
Size 284.1 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
afadbd60daa9e89bad3bb058d59f6ee7e5612c3f3e65eb21a7399123b006553d
BLAKE2b-256 checksum
How to use checksums
cd3e30bbbb5069d9aabec7e64972797ba94b27f7c83be607a18f5ecb42215651
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.51.0 This release

6 release files

0.49.0

6 release files

0.48.0

6 release files

0.46.2

1 release file

0.45.1

8 release files

0.45.0

9 release files

0.44.0

7 release files

0.43.0

7 release files

0.42.0

7 release files

0.41.0

1 release file

0.40.1

1 release file

0.40.0

1 release file

0.39.0

1 release file

0.38.0

1 release file

0.37.1

1 release file

0.37.0

1 release file

0.36.0

1 release file

0.35.2

1 release file

0.35.1

1 release file

0.35.0

1 release file

0.34.0

1 release file

0.33.0

1 release file

0.32.0

1 release file

0.31.0

1 release file

0.30.1

1 release file

0.30.0

1 release file

0.29.0

1 release file

0.28.2

1 release file

0.28.1

1 release file

0.28.0

1 release file

0.27.0

1 release file

0.26.4

1 release file

0.26.3

1 release file

0.26.2

1 release file

0.26.0

1 release file

0.25.1

1 release file

0.25.0

1 release file

0.24.0

1 release file

0.23.0

1 release file

0.22.5

1 release file

0.22.4

1 release file

0.22.3

1 release file

0.21.1

1 release file

0.21

1 release file

0.20.2

1 release file

0.20.1

1 release file

0.20

1 release file

0.19.1

1 release file

0.19

1 release file

0.18.2

1 release file

0.18.1

1 release file

0.18

1 release file

0.17

1 release file

0.16

1 release file

0.15

1 release file

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