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://codefloe.com/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.50.0.tar.gz (538.1 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.50.0-cp314-cp314-win_amd64.whl (287.2 kB view details)

Uploaded CPython 3.14Windows x86-64

m2crypto-0.50.0-cp313-cp313-win_amd64.whl (279.8 kB view details)

Uploaded CPython 3.13Windows x86-64

m2crypto-0.50.0-cp312-cp312-win_amd64.whl (279.7 kB view details)

Uploaded CPython 3.12Windows x86-64

m2crypto-0.50.0-cp311-cp311-win_amd64.whl (280.8 kB view details)

Uploaded CPython 3.11Windows x86-64

m2crypto-0.50.0-cp310-cp310-win_amd64.whl (280.6 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for m2crypto-0.50.0.tar.gz
Algorithm Hash digest
SHA256 4162b1fbb51ef3b3f98cb81e086d706cad8fe7620a5549f398c1efbc0dad0d92
MD5 e1e072dba180da7bbf4dc0e0ce4384f9
BLAKE2b-256 4025d909899fe1be051df16749049412045d90f56acae2c8f2c5b57f29694cc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.50.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.50.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.50.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 287.2 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.50.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7d5f0d8ecfce3861f0e66d2429b606795775077bbe4c6cb7feb1a00c4274ecc5
MD5 ff4a31f576dcfc355dc8ad9ea83a1823
BLAKE2b-256 a29c86f1dc4ce95a4d5409edde7501ccf13d495b865ca67d2574de780bcbb47c

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.50.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.50.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.50.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 279.8 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.50.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 696c1da9b0dcd099d082658051483c54f190adf2818ce7f8b9069853f0e2d408
MD5 3c3b330da4cb21534ecffd5cecb5c549
BLAKE2b-256 5038de733d3845f5c1000a385f16bd40003ebc6878e527eb7553c9aeeba6edfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.50.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.50.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.50.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 279.7 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.50.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2f51574396a1da07f4c2a9ac6b4d02fb50de71060f2a537d282554d1d07f0411
MD5 6d9ff235488d7c598c1c25582a0b491f
BLAKE2b-256 bb2c8372c82b701eafdf07ac641e6546f41f382959c767023d7db14e20079291

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.50.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.50.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.50.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 280.8 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.50.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 15111005c5653628c471e9639215b0c288869112ebda49650029e4b9af3c7b9a
MD5 a6f093ec91f9e74e24200d1c7620d9a3
BLAKE2b-256 56e7c67bc4d617a47afdea99176f8118a855b095685c7d0cb8f7cc88c7c46f1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.50.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.50.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: m2crypto-0.50.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 280.6 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.50.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c02edffb1741fe9891f4b20d4b71b6d07dcf1a2a6e21f560d8aae70ef76fd33f
MD5 c1bdfdf437464f05507a62688d77ef31
BLAKE2b-256 f3bb0a763615bfbc66f9866f668a801ad0753fcb22004fbb84f87512e07207bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.50.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.

Release history Release notifications | RSS feed

This release

0.50.0 This release

6 files

0.49.0

6 files

0.48.0

6 files

0.47.0

6 files

0.46.2

1 file

0.46.0

8 files

0.45.1

8 files

0.45.0

9 files

0.44.0

7 files

0.43.0

7 files

0.42.0

7 files

0.41.0

1 file

0.40.1

1 file

0.40.0

1 file

0.39.0

1 file

0.38.0

1 file

0.37.1

1 file

0.37.0

1 file

0.36.0

1 file

0.35.2

1 file

0.35.1

1 file

0.35.0

1 file

0.34.0

1 file

0.33.0

1 file

0.32.0

1 file

0.31.0

1 file

0.30.1

1 file

0.30.0

1 file

0.29.0

1 file

0.28.2

1 file

0.28.1

1 file

0.28.0

1 file

0.27.0

1 file

0.26.4

1 file

0.26.3

1 file

0.26.2

1 file

0.26.0

1 file

0.25.1

1 file

0.25.0

1 file

0.24.0

1 file

0.23.0

1 file

0.22.5

1 file

0.22.4

1 file

0.22.3

1 file

0.21.1

1 file

0.21

1 file

0.20.2

1 file

0.20.1

1 file

0.20

1 file

0.19.1

1 file

0.19

1 file

0.18.2

1 file

0.18.1

1 file

0.18

1 file

0.17

1 file

0.16

1 file

0.15

1 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