{"id":13398488,"url":"https://github.com/pycrypto/pycrypto","last_synced_at":"2025-09-28T23:32:09.377Z","repository":{"id":37471425,"uuid":"1124202","full_name":"pycrypto/pycrypto","owner":"pycrypto","description":"The Python Cryptography Toolkit","archived":true,"fork":false,"pushed_at":"2022-01-26T16:04:12.000Z","size":12155,"stargazers_count":2449,"open_issues_count":212,"forks_count":638,"subscribers_count":118,"default_branch":"master","last_synced_at":"2024-08-04T22:09:38.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.pycrypto.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pycrypto.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-30T02:10:21.000Z","updated_at":"2024-07-25T09:14:42.000Z","dependencies_parsed_at":"2022-07-12T15:50:40.362Z","dependency_job_id":null,"html_url":"https://github.com/pycrypto/pycrypto","commit_stats":null,"previous_names":["dlitz/pycrypto"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycrypto%2Fpycrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycrypto%2Fpycrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycrypto%2Fpycrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycrypto%2Fpycrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pycrypto","download_url":"https://codeload.github.com/pycrypto/pycrypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234575211,"owners_count":18854924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:00:27.386Z","updated_at":"2025-09-28T23:32:03.225Z","avatar_url":"https://github.com/pycrypto.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"| ⚠️ WARNING                                                                    |\n|:-----------------------------------------------------------------------------|\n| **PyCrypto 2.x is unmaintained, obsolete, and contains security vulnerabilities.** \u003cbr\u003e See \u003chttps://www.pycrypto.org/\u003e for details. The following is provided for historical/reference purposes only. |\n\n\u003c!--\nIf that site is no longer available, you can also look at `index.md` in the\n`www.pycrypto.org` branch of this repository.  The old generated docs and\nmailing list archive can also be found there.\n--\u003e\n\nPython Cryptography Toolkit (pycrypto)\n======================================\n\nThis is a collection of both secure hash functions (such as SHA256 and\nRIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,\netc.).  The package is structured to make adding new modules easy.\nThis section is essentially complete, and the software interface will\nalmost certainly not change in an incompatible way in the future; all\nthat remains to be done is to fix any bugs that show up.  ~~If you\nencounter a bug, please report it in the GitHub issue tracker at\n\u003chttps://github.com/dlitz/pycrypto/issues\u003e~~\n\nAn example usage of the SHA256 module is:\n\n```python\n\u003e\u003e\u003e from Crypto.Hash import SHA256\n\u003e\u003e\u003e hash = SHA256.new()\n\u003e\u003e\u003e hash.update('message')\n\u003e\u003e\u003e hash.digest()\n'\\xabS\\n\\x13\\xe4Y\\x14\\x98+y\\xf9\\xb7\\xe3\\xfb\\xa9\\x94\\xcf\\xd1\\xf3\\xfb\"\\xf7\\x1c\\xea\\x1a\\xfb\\xf0+F\\x0cm\\x1d'\n```\n\nAn example usage of an encryption algorithm (AES, in this case) is:\n\n```python\n\u003e\u003e\u003e from Crypto.Cipher import AES\n\u003e\u003e\u003e obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')\n\u003e\u003e\u003e message = \"The answer is no\"\n\u003e\u003e\u003e ciphertext = obj.encrypt(message)\n\u003e\u003e\u003e ciphertext\n'\\xd6\\x83\\x8dd!VT\\x92\\xaa`A\\x05\\xe0\\x9b\\x8b\\xf1'\n\u003e\u003e\u003e obj2 = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')\n\u003e\u003e\u003e obj2.decrypt(ciphertext)\n'The answer is no'\n```\n\nOne possible application of the modules is writing secure\nadministration tools.  Another application is in writing daemons and\nservers.  Clients and servers can encrypt the data being exchanged and\nmutually authenticate themselves; daemons can encrypt private data for\nadded security.  Python also provides a pleasant framework for\nprototyping and experimentation with cryptographic algorithms; thanks\nto its arbitrary-length integers, public key algorithms are easily\nimplemented.\n\nAs of PyCrypto 2.1.0, PyCrypto provides an easy-to-use random number\ngenerator:\n\n```python\n\u003e\u003e\u003e from Crypto import Random\n\u003e\u003e\u003e rndfile = Random.new()\n\u003e\u003e\u003e rndfile.read(16)\n'\\xf7.\\x838{\\x85\\xa0\\xd3\u003e#}\\xc6\\xc2jJU'\n```\n\nA stronger version of Python's standard \"random\" module is also\nprovided:\n\n```python\n\u003e\u003e\u003e from Crypto.Random import random\n\u003e\u003e\u003e random.choice(['dogs', 'cats', 'bears'])\n'bears'\n```\n\nCaveat: For the random number generator to work correctly, you must\ncall Random.atfork() in both the parent and child processes after\nusing os.fork()\n\n\nInstallation\n============\n\nPyCrypto is written and tested using Python version 2.1 through 3.3.  Python\n1.5.2 is not supported.\n\nThe modules are packaged using the Distutils, so you can simply run\n`python setup.py build` to build the package, and \"python setup.py\ninstall\" to install it.\n\nLinux installation requires the Python developer tools to be installed. These\ncan be found in the `python-dev` package on Debian/Ubuntu and the\n`python2-devel` package on Red Hat/Fedora. If you are using a non-standard\nPython version for your distribution, you may require a different package.\nConsult your package manager's documentation for instructions on how to\ninstall these packages. Other distributions may have different package names.\n\nTo verify that everything is in order, run `python setup.py test`.  It\nwill test all the cryptographic modules, skipping ones that aren't\navailable.  ~~If the test script reports an error on your machine,\nplease report the bug using the bug tracker (URL given above).  If\npossible, track down the bug and include a patch that fixes it,\nprovided that you are able to meet the eligibility requirements at\n[https://www.pycrypto.org/submission-requirements/].~~\n\nIt is possible to test a single sub-package or a single module only, for instance\nwhen you investigate why certain tests fail and don't want to run the whole\nsuite each time. Use `python setup.py test --module=name`, where 'name'\nis either a sub-package (Cipher, PublicKey, etc) or a module (Cipher.DES,\nPublicKey.RSA, etc).\nTo further cut test coverage, pass also the option `--skip-slow-tests`.\n\nTo install the package under the site-packages directory of\nyour Python installation, run `python setup.py install`.\n\nIf you have any comments, corrections, or improvements for this\npackage, please report them to our mailing list, accessible via the\nPyCrypto website:\n\n\u003chttps://www.pycrypto.org/\u003e\u003cbr\u003e\n\u003chttps://www.dlitz.net/software/pycrypto/\u003e\n\n[https://www.pycrypto.org/submission-requirements/]: ./LEGAL/CodeSubmissionRequirements.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycrypto%2Fpycrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycrypto%2Fpycrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycrypto%2Fpycrypto/lists"}