Skip to main content

A Python crypto and SSL toolkit

Project description

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.

Project details


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.48.0.tar.gz (531.8 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.48.0-cp314-cp314-win_amd64.whl (281.4 kB view details)

Uploaded CPython 3.14Windows x86-64

m2crypto-0.48.0-cp313-cp313-win_amd64.whl (274.3 kB view details)

Uploaded CPython 3.13Windows x86-64

m2crypto-0.48.0-cp312-cp312-win_amd64.whl (274.2 kB view details)

Uploaded CPython 3.12Windows x86-64

m2crypto-0.48.0-cp311-cp311-win_amd64.whl (275.2 kB view details)

Uploaded CPython 3.11Windows x86-64

m2crypto-0.48.0-cp310-cp310-win_amd64.whl (275.0 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

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

File metadata

  • Download URL: m2crypto-0.48.0.tar.gz
  • Upload date:
  • Size: 531.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for m2crypto-0.48.0.tar.gz
Algorithm Hash digest
SHA256 178e290f558ddf0379aaefd34c0a8ddb21f21502594e588f928dda85f1ad202b
MD5 ebf985c15a27c9bae6c4eb44e1a9b81a
BLAKE2b-256 897a06ed5c66d63506bc77a7823d56e5e6b4ad3143f3fca2337c46d8b2c191f5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: m2crypto-0.48.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 281.4 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for m2crypto-0.48.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 14f6233f7d8d87435d1e360ec284f88bdb9c19da3b99ba95f291262e89a69db2
MD5 ddbe2ce1b620d5e82c2b7b8645d57e2b
BLAKE2b-256 87f66eae27244be85b2c015d914f7ebed416870563153af265da121299da8c36

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: m2crypto-0.48.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 274.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for m2crypto-0.48.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 074da24da3bbe27480e70a0f3de2f33464bad69316c7ccd626e457cc2fd21aef
MD5 f1c4c3e761257845f2eb3e08d6e1d843
BLAKE2b-256 f09c065c488210c78b7f4fdee5f835f7ea1fe6cfbba14cc9fdb9fa40a4139f69

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: m2crypto-0.48.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 274.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for m2crypto-0.48.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 70b2b342b123c7843d1e78e8c5bece3438d0875fbcb0c733f03e1db61f828a0c
MD5 0823abcd04348c9bb3dc0896c686c11b
BLAKE2b-256 938263cb96cb07b8bf95f926467082e0d8f80733e08ab55bc5ad21f209106bd7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: m2crypto-0.48.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 275.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for m2crypto-0.48.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6c97ca74e0bc442927c3907da508af62aeee8dd19a55ef364b390a7515e27524
MD5 c658bb4d54e489aaca4e0b7a9d17e597
BLAKE2b-256 bd5b5f3c7ff05258059696e4a48bb85106d742c65b8496267c1d4722687e823f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: m2crypto-0.48.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 275.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for m2crypto-0.48.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6eae43e9268037f7b660312c00b64f217ec21e40dd9234e9e609ec784eb9b3d1
MD5 02395c99b888f28a57b503fdbce90232
BLAKE2b-256 4db14580ff2c332ca5aa903a01836865802fd93327642f3b44f8ff5bcaa550f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for m2crypto-0.48.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 Pingdom Monitoring Sentry Error logging StatusPage Status page