{"id":21358600,"url":"https://github.com/holgern/py-scrypt","last_synced_at":"2025-04-05T08:06:14.454Z","repository":{"id":52867953,"uuid":"120079872","full_name":"holgern/py-scrypt","owner":"holgern","description":"This is a set of Python bindings for the scrypt key derivation function.","archived":false,"fork":false,"pushed_at":"2024-10-11T19:25:32.000Z","size":209,"stargazers_count":29,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T07:06:05.182Z","etag":null,"topics":["scrypt"],"latest_commit_sha":null,"homepage":"","language":"C","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/holgern.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-03T10:06:22.000Z","updated_at":"2025-01-19T08:16:15.000Z","dependencies_parsed_at":"2024-01-20T10:39:35.792Z","dependency_job_id":"99e8fc07-c564-4cac-87c3-53d97c48ce58","html_url":"https://github.com/holgern/py-scrypt","commit_stats":{"total_commits":200,"total_committers":5,"mean_commits":40.0,"dds":"0.21499999999999997","last_synced_commit":"6908fda9613675b589e361ec9e4388116cc5de4a"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgern%2Fpy-scrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgern%2Fpy-scrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgern%2Fpy-scrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgern%2Fpy-scrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holgern","download_url":"https://codeload.github.com/holgern/py-scrypt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305933,"owners_count":20917208,"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":["scrypt"],"created_at":"2024-11-22T05:20:10.860Z","updated_at":"2025-04-05T08:06:14.427Z","avatar_url":"https://github.com/holgern.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========================\n Python scrypt_ bindings\n=========================\n\nThis is a set of Python_ bindings for the scrypt_ key derivation\nfunction.\n\n.. image:: https://img.shields.io/pypi/v/scrypt.svg\n    :target: https://pypi.python.org/pypi/scrypt/\n    :alt: Latest Version\n\n.. image:: https://anaconda.org/conda-forge/scrypt/badges/version.svg\n    :target: https://anaconda.org/conda-forge/scrypt\n\n.. image:: https://anaconda.org/conda-forge/scrypt/badges/downloads.svg\n    :target: https://anaconda.org/conda-forge/scrypt\n\n\nScrypt is useful when encrypting password as it is possible to specify\na *minimum* amount of time to use when encrypting and decrypting. If,\nfor example, a password takes 0.05 seconds to verify, a user won't\nnotice the slight delay when signing in, but doing a brute force\nsearch of several billion passwords will take a considerable amount of\ntime. This is in contrast to more traditional hash functions such as\nMD5 or the SHA family which can be implemented extremely fast on cheap\nhardware.\n\nInstallation\n============\n\nFor Debian and Ubuntu, please ensure that the following packages are installed:\n\n.. code:: bash\n\n    $ sudo apt-get install build-essential libssl-dev python-dev\n\nFor Fedora and RHEL-derivatives, please ensure that the following packages are installed:\n\n.. code:: bash\n\n    $ sudo yum install gcc openssl-devel python-devel\n\nFor OSX, please do the following::\n\n    $ brew install openssl\n    $ export CFLAGS=\"-I$(brew --prefix openssl)/include $CFLAGS\"\n    $ export LDFLAGS=\"-L$(brew --prefix openssl)/lib $LDFLAGS\"\n\nFor OSX, you can also use the precompiled wheels. They are installed by::\n\n    $ pip install scrypt\n\nFor Windows, please use the precompiled wheels. They are installed by::\n\n    $ pip install scrypt\n\nFor Windows, when the package should be compiled, the development package from https://slproweb.com/products/Win32OpenSSL.html is needed.\nIt needs to be installed to C:\\OpenSSL-Win64.\n\nYou can install py-scrypt from this repository if you want the latest\nbut possibly non-compiling version::\n\n    $ git clone https://github.com/holgern/py-scrypt.git\n    $ cd py-scrypt\n    $ python setup.py build\n\n    Become superuser (or use virtualenv):\n    # python setup.py install\n\n    Run tests after install:\n    $ python setup.py test\n\nOr you can install the latest release from PyPi::\n\n    $ pip install scrypt\n\nUsers of the Anaconda_ Python distribution can directly obtain pre-built\nWindows, Intel Linux or macOS / OSX binaries from the conda-forge channel.\nThis can be done via::\n\n    $ conda install -c conda-forge scrypt\n\n\nIf you want py-scrypt for your Python 3 environment, just run the\nabove commands with your Python 3 interpreter. Py-scrypt supports both\nPython 2 and 3.\n\nFrom version 0.6.0 (not available on PyPi yet), py-scrypt supports\nPyPy as well.\n\nChangelog\n=========\n0.8.24\n------\n* Building of all wheels works with github actions\n\n0.8.20\n------\n* Fix #8 by adding missing gettimeofday.c to MANIFEST.in\n\n0.8.19\n------\n* Use RtlGenRandom instead of CryptGenRandom on windows (Thanks to https://github.com/veorq/cryptocoding/)\n* Add check for c:\\Program Files\\OpenSSL-Win64 and c:\\Program Files\\OpenSSL-Win32\n\n0.8.18\n------\n* add wheel for python 3.9\n\n0.8.17\n------\n\n* add_dll_directory for python 3.8 on windows, as importlib.util.find_spec does not search all paths anymore\n\n0.8.16\n------\n\n* Add additional test vector from RFC (thanks to @ChrisMacNaughton)\n\n0.8.15\n------\n\n* Fix missing import\n\n\n0.8.14\n------\n\n* fix imp deprecation warning\n\n\n0.8.13\n------\n\n* improve build for conda forge\n\n0.8.12\n------\n\n* Add SCRYPT_WINDOWS_LINK_LEGACY_OPENSSL environment variable, when set, openssl 1.0.2 is linked\n\n0.8.11\n------\n\n* fix build for conda feedstock\n\n0.8.10\n------\n\n* fix typo\n\n0.8.9\n-----\n\n* use the static libcrypto_static for windows and openssl 1.1.1\n\n0.8.8\n-----\n\n* setup.py for windows improved, works with openssl 1.0.2 and 1.1.1\n\n0.8.7\n-----\n\n* setup.py for windows fixed\n\n0.8.6\n-----\n\n* setup.py fixed, scrypt could not be imported in version 0.8.5\n\n0.8.5\n-----\n\n* MANIFEST.in fixed\n* scrypt.py moved into own scrypt directory with __init__.py\n* openssl library path for osx wheel repaired\n\n0.8.4\n-----\n\n* __version__ added to scrypt\n* missing void in sha256.c fixed\n\n0.8.3\n-----\n\n* scrypt updated to 1.2.1\n* Wheels are created for python 3.6\n\nUsage\n=====\n\nFore encryption/decryption, the library exports two functions\n``encrypt`` and ``decrypt``::\n\n    \u003e\u003e\u003e import scrypt\n    \u003e\u003e\u003e data = scrypt.encrypt('a secret message', 'password', maxtime=0.1) # This will take at least 0.1 seconds\n    \u003e\u003e\u003e data[:20]\n    'scrypt\\x00\\r\\x00\\x00\\x00\\x08\\x00\\x00\\x00\\x01RX9H'\n    \u003e\u003e\u003e scrypt.decrypt(data, 'password', maxtime=0.1) # This will also take at least 0.1 seconds\n    'a secret message'\n    \u003e\u003e\u003e scrypt.decrypt(data, 'password', maxtime=0.05) # scrypt won't be able to decrypt this data fast enough\n    Traceback (most recent call last):\n      File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n    scrypt.error: decrypting file would take too long\n    \u003e\u003e\u003e scrypt.decrypt(data, 'wrong password', maxtime=0.1) # scrypt will throw an exception if the password is incorrect\n    Traceback (most recent call last):\n      File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n    scrypt.error: password is incorrect\n\nFrom these, one can make a simple password verifier using the following\nfunctions::\n\n    def hash_password(password, maxtime=0.5, datalength=64):\n        return scrypt.encrypt(os.urandom(datalength), password, maxtime=maxtime)\n\n    def verify_password(hashed_password, guessed_password, maxtime=0.5):\n        try:\n            scrypt.decrypt(hashed_password, guessed_password, maxtime)\n            return True\n        except scrypt.error:\n            return False\n\n\nBut, if you want output that is deterministic and constant in size,\nyou can use the ``hash`` function::\n\n    \u003e\u003e\u003e import scrypt\n    \u003e\u003e\u003e h1 = scrypt.hash('password', 'random salt')\n    \u003e\u003e\u003e len(h1)  # The hash will be 64 bytes by default, but is overridable.\n    64\n    \u003e\u003e\u003e h1[:10]\n    '\\xfe\\x87\\xf3hS\\tUo\\xcd\\xc8'\n    \u003e\u003e\u003e h2 = scrypt.hash('password', 'random salt')\n    \u003e\u003e\u003e h1 == h2 # The hash function is deterministic\n    True\n\n\nAcknowledgements\n================\n\nScrypt_ was created by Colin Percival and is licensed as 2-clause BSD.\nSince scrypt does not normally build as a shared library, I have included\nthe source for the currently latest version of the library in this\nrepository. When a new version arrives, I will update these sources.\n\n`Kelvin Wong`_ on Bitbucket provided changes to make the library\navailable on Mac OS X 10.6 and earlier, as well as changes to make the\nlibrary work more like the command-line version of scrypt by\ndefault. Kelvin also contributed with the unit tests, lots of cross\nplatform testing and work on the ``hash`` function.\n\nBurstaholic_ on Bitbucket provided the necessary changes to make\nthe library build on Windows.\n\nThe `python-appveyor-demo`_ repository for setting up automated Windows\nbuilds for a multitude of Python versions.\n\nLicense\n=======\n\nThis library is licensed under the same license as scrypt; 2-clause BSD.\n\n.. _scrypt: http://www.tarsnap.com/scrypt.html\n.. _Python: http://python.org\n.. _Burstaholic: https://bitbucket.org/Burstaholic\n.. _Kelvin Wong: https://bitbucket.org/kelvinwong_ca\n.. _python-appveyor-demo: https://github.com/ogrisel/python-appveyor-demo\n.. _Anaconda: https://www.continuum.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholgern%2Fpy-scrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholgern%2Fpy-scrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholgern%2Fpy-scrypt/lists"}