Skip to main content

A Python crypto and SSL toolkit

Project description

Maintainer:

Matěj Cepl

Web-Site:

https://sr.ht/~mcepl/m2crypto/

Documentation:

https://m2crypto.readthedocs.io/

Issue tracker:

https://todo.sr.ht/~mcepl/m2crypto (R/O, please report issues via the email list).

M2Crypto = Python + OpenSSL + SWIG

builds.sr.ht status

NOTE: This library is currently in maintenance mode. 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 MIT licence. See LICENCE 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.43.0.tar.gz (366.8 kB view details)

Uploaded Source

Built Distributions

M2Crypto-0.43.0-cp312-cp312-win_amd64.whl (260.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

M2Crypto-0.43.0-cp312-cp312-win32.whl (199.5 kB view details)

Uploaded CPython 3.12 Windows x86

M2Crypto-0.43.0-cp311-cp311-win_amd64.whl (261.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

M2Crypto-0.43.0-cp311-cp311-win32.whl (200.5 kB view details)

Uploaded CPython 3.11 Windows x86

M2Crypto-0.43.0-cp310-cp310-win_amd64.whl (261.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

M2Crypto-0.43.0-cp310-cp310-win32.whl (200.3 kB view details)

Uploaded CPython 3.10 Windows x86

File details

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

File metadata

  • Download URL: m2crypto-0.43.0.tar.gz
  • Upload date:
  • Size: 366.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for m2crypto-0.43.0.tar.gz
Algorithm Hash digest
SHA256 6c2c1c7bb0e8aa768f7ca803da7dbc2666d4003b26bd7adf70233afc59d8cf33
MD5 75c50150857eb60e4f447b04d13ff507
BLAKE2b-256 ff1b4771f0ecfdd9df6752ae5d0cf040545bb3cfe8a504af87e05c9ac4a6a499

See more details on using hashes here.

File details

Details for the file M2Crypto-0.43.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for M2Crypto-0.43.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5d7002faa032ec529efdd5d1cdea2b0490e61852e533e5e5e0064a14ba16574e
MD5 226f14a7cbda53ec4769f061d28c0b7f
BLAKE2b-256 ff49a8eeaf114e0685eb1bf0f335f6f041d887e4a1f8b857b7b5e11122ac5bde

See more details on using hashes here.

File details

Details for the file M2Crypto-0.43.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: M2Crypto-0.43.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 199.5 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for M2Crypto-0.43.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 736c26b68a4bdcd92384e01af93d8386734596c84b7e702b5373457afc48b7e4
MD5 26083bd9ec9684f12a6aec1c56c3e661
BLAKE2b-256 3dcea85825c4c22fc9bfd2887fbe75fda2a1d9db27c0636f212946cf0d087275

See more details on using hashes here.

File details

Details for the file M2Crypto-0.43.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for M2Crypto-0.43.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 863e46091db3e3d03024ac9ad6be128aed2f756ab90ca8ea1f46fb4d36bde587
MD5 80ca8c6eae5eb3021f54d9c596e1d97f
BLAKE2b-256 40634f01f3b402a70f5d6ffc48c3f9610ab72d5cacc01946087080d4eeb26bb7

See more details on using hashes here.

File details

Details for the file M2Crypto-0.43.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: M2Crypto-0.43.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 200.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for M2Crypto-0.43.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 d6be04b34c787133bb01427361d137034da193a6e20b270977f07f3c84587e24
MD5 a592ede4ab35aa7f65839069b02f9ae8
BLAKE2b-256 9c999ca267bb89d1540ca45d5eeff11587e5c50a1e0665669fb9631c11fb58f8

See more details on using hashes here.

File details

Details for the file M2Crypto-0.43.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for M2Crypto-0.43.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 17518507c6cf34181a0f018d1faae8a954a6d172522b76db51c9a7d90171c631
MD5 13f0e643278e5107c052ff2c57cc582b
BLAKE2b-256 14d8eedfeb19e916fb15ba85183bb662469a9c5d5136edd2a95e450226d78faa

See more details on using hashes here.

File details

Details for the file M2Crypto-0.43.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: M2Crypto-0.43.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 200.3 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for M2Crypto-0.43.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 178da718a8f81f40d0da6c129eb0869a90b9564e5e6dc56fa2563ce4d72683dd
MD5 312863d13180481f7bfd0acfef7f2d09
BLAKE2b-256 472e49cbe3fbba4eb580a2db0d05db06360b17017795fe85c91ea26749ef8339

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page