{ "info": { "author": "Tarjei Hus\u00f8y", "author_email": "git@thusoy.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# python-crypt [![Build Status](https://travis-ci.org/thusoy/python-crypt.svg?branch=master)](https://travis-ci.org/thusoy/python-crypt)\n\nPure-python implementation of the crypt(3) SHA2 functions.\n\nUseful for creating crypt-compatible hashes from non-*nixes (like Windows\nand OS X), like when creating password hashes to initialize a *nix server\nwith.\n\n\n## Install\n\n $ pip install pcrypt\n\n\n## Usage\n\nAPI is identical to the [built-in crypt](https://docs.python.org/3.5/library/crypt.html) module on *nix:\n\n >>> import pcrypt, getpass\n >>> print(pcrypt.crypt(getpass.getpass()))\n $6$tyjS23QPnY6k37iD$7oM9nObOVQUQ<...>/x7VKbuiyqgT81\n\nIf you want to override the number of rounds used for hashing, you can specify the parameter `rounds` to crypt:\n\n >>> print(pcrypt.crypt(getpass.getpass(), rounds=50000))\n $6$rounds=50000$FEkeiFqoGiU6Bd3v$6jn8ZZ<...>uXKvs7XAbp.\n\nThe default number of rounds is 5000, same as for crypt(3).\n\nTo use SHA256 instead of the default SHA512:\n\n >>> print(pcrypt.crypt(getpass.getpass(), pcrypt.METHOD_SHA256))\n $5$Zcxyug8MUozUjGIQ$yqvzOQR<...>pnLMvpOhhmrOWfn5\n\nIf the second argument is given it must be either an existing salt string matching the\nformat `$$(rounds=$)?($)?`, or one of `pcrypt.METHOD_SHA256`\nor `pcrypt.METHOD_SHA512`.\n\nWithout specifying salt manually the module will generate a new salt and use\nthe strongest hash function available.\n\nAs a little extra nugget, there's also a handy CLI to quickly generate a hash:\n\n $ pcrypt -h\n usage: pcrypt [-h] [-r ROUNDS] [-a {sha256,sha512}] [-s]\n\n Compute a password hash for SHA256/SHA512 in crypt(3)-compatible format.\n Password will be prompted for.\n\n optional arguments:\n -h, --help show this help message and exit\n -r ROUNDS, --rounds ROUNDS\n How many rounds of hashing to perform. More rounds are\n slower, making it harder to reverse a hash through\n brute force. Default: 5000\n -a {sha256,sha512}, --algo {sha256,sha512}\n Which algorithm to use. Default: sha512\n -s, --single-prompt Don't ask to repeat the password\n\n**NB**: You'd probably guess from this being a pure-python implementation of a compute-heavy operation, but I just have to say this explicitly: Do not use this for performance-critical applications! Performance is roughly five orders of magnitude slower than the plain C version.\n\nChange log\n==========\n\n[1.0.5] - 2018-01-12\n--------------------\n\n### Fixed\n- Only print trailing newline in cli when writing to a tty.\n\n\n[1.0.4] - 2016-02-08\n--------------------\n\n### Added\n- Passwords can now be piped in to the pcrypt CLI.\n\n\n[1.0.3] - 2015-12-19\n--------------------\n\nPractically first release.\n\n\n[1.0.5]: https://github.com/thusoy/python-crypt/compare/v1.0.4...v1.0.5\n[1.0.4]: https://github.com/thusoy/python-crypt/compare/v1.0.3...v1.0.4", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thusoy/python-crypt", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pcrypt", "package_url": "https://pypi.org/project/pcrypt/", "platform": "", "project_url": "https://pypi.org/project/pcrypt/", "project_urls": { "Homepage": "https://github.com/thusoy/python-crypt" }, "release_url": "https://pypi.org/project/pcrypt/1.0.5/", "requires_dist": null, "requires_python": "", "summary": "Pure-python implementation of the SHA2 crypt(3) functions", "version": "1.0.5" }, "last_serial": 4689168, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "abd2341f4f4e61bd0ea125c37f576cd7", "sha256": "149190e962b9c739fcacbfb7ca523ed384ae630ac28f8ef43a6d420da34e53f6" }, "downloads": -1, "filename": "pcrypt-1.0.0.tar.gz", "has_sig": false, "md5_digest": "abd2341f4f4e61bd0ea125c37f576cd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3857, "upload_time": "2015-12-19T00:41:15", "url": "https://files.pythonhosted.org/packages/cc/4e/36b6b5327a23dea6583218c48d217fd28363ebe8eef024b80856aa466946/pcrypt-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5ca6acb75855a09e0724a3618dd77791", "sha256": "d78800a97d06c1e265ada6644bdf2838932900656221b992696811c2f5a1323e" }, "downloads": -1, "filename": "pcrypt-1.0.1.tar.gz", "has_sig": true, "md5_digest": "5ca6acb75855a09e0724a3618dd77791", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4148, "upload_time": "2015-12-19T09:10:54", "url": "https://files.pythonhosted.org/packages/fc/66/9089aab0b8d569a9d22bd6c1a25874c3945cd6841fdd7864a67e65ffb32e/pcrypt-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "5f464c4960c6673d1d660ddf4c21c6c7", "sha256": "290d6c6b366ed7792195f75db6c09abf9c9384810e22105dbe811dcb29456207" }, "downloads": -1, "filename": "pcrypt-1.0.2.tar.gz", "has_sig": true, "md5_digest": "5f464c4960c6673d1d660ddf4c21c6c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4318, "upload_time": "2015-12-19T13:21:36", "url": "https://files.pythonhosted.org/packages/9f/0a/b2ac007353de4ce40fe8e27c26dd94787340a38b67bb307ae1c57e5ecacd/pcrypt-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "02924458ba401b52bb5355d5b6ab5ec9", "sha256": "9c0e455a394bf0e152dd7f38c3097dd0479de35aad4af20f56357bd387551dec" }, "downloads": -1, "filename": "pcrypt-1.0.3.tar.gz", "has_sig": true, "md5_digest": "02924458ba401b52bb5355d5b6ab5ec9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4329, "upload_time": "2015-12-19T13:55:38", "url": "https://files.pythonhosted.org/packages/73/08/2b65105bbb1c85e90786192b5955b27129db63d66d058ddf7d402cf77845/pcrypt-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "bc6e2327620926bcf30ce71922ad7cfc", "sha256": "291610bb6d0c7420c0a81cb1a2d23d110b3cb8f34fa8ebd05417337309b8886e" }, "downloads": -1, "filename": "pcrypt-1.0.4.tar.gz", "has_sig": true, "md5_digest": "bc6e2327620926bcf30ce71922ad7cfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5861, "upload_time": "2016-02-09T07:11:12", "url": "https://files.pythonhosted.org/packages/39/60/3cdbcbf43275f02ceeccdabc6b5a3112ddf24bfc99c62cad4db6f393223a/pcrypt-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "10f5dc86c68639c4840f8dbdd38366df", "sha256": "61f0cb73900aa8bf682f9347bc7f8468dbe9f7fd861ff3be246e2f0c23c18405" }, "downloads": -1, "filename": "pcrypt-1.0.5.tar.gz", "has_sig": false, "md5_digest": "10f5dc86c68639c4840f8dbdd38366df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6031, "upload_time": "2019-01-12T21:06:40", "url": "https://files.pythonhosted.org/packages/66/6f/26667b2feb5e12561eb31d08be5213ec884610713b583fe67bf75a8807d1/pcrypt-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "10f5dc86c68639c4840f8dbdd38366df", "sha256": "61f0cb73900aa8bf682f9347bc7f8468dbe9f7fd861ff3be246e2f0c23c18405" }, "downloads": -1, "filename": "pcrypt-1.0.5.tar.gz", "has_sig": false, "md5_digest": "10f5dc86c68639c4840f8dbdd38366df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6031, "upload_time": "2019-01-12T21:06:40", "url": "https://files.pythonhosted.org/packages/66/6f/26667b2feb5e12561eb31d08be5213ec884610713b583fe67bf75a8807d1/pcrypt-1.0.5.tar.gz" } ] }