{ "info": { "author": "Christopher H. Casebeer", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "HKDF - HMAC Key Derivation Function\r\n===================================\r\n\r\nThis module implements the HMAC Key Derivation function, defined at\r\n\r\n http://tools.ietf.org/html/draft-krawczyk-hkdf-01\r\n\r\nThere are two interfaces: a functional interface, with separate extract\r\nand expand functions as defined in the draft RFC, and a wrapper class for\r\nthese functions.\r\n\r\nFunctional interface\r\n--------------------\r\n\r\nTo use the functional interface, pass the pseudorandom key generated\r\nby ``hmac_extract([salt], [input key material])`` to ``hmac_expand(...)``.\r\n``salt`` should be a random, non-secret, site-specific string, but may be\r\nset to None. See section 3.1 of the HKDF draft for more details.\r\n\r\nIn addition to the PRK output by ``hmac_extract()``, ``hmac_expand()`` takes an\r\n``info`` argument, which permits generating multiple keys based on the\r\nsame PRK, and a ``length`` argument, which defines the number of bytes\r\nof output key material to generate. ``length`` must be less than or equal\r\nto 255 time the block size, in bytes, of the hash function being used.\r\nSee section 3.2 of the HKDF draft for more information on using the ``info``\r\nargument.\r\n\r\nThe hash function to use can be specified for both ``hmac_extract()`` and\r\n``hmac_expand()`` as the ``hash`` kw argument, and **defaults to SHA-512** as implemented\r\nby the hashlib module. It must be the same for both extracting and expanding.\r\n\r\nExample::\r\n\r\n from binascii import unhexlify\r\n prk = hkdf_extract(unhexlify(b\"8e94ef805b93e683ff18\"), b\"asecretpassword\")\r\n key = hkdf_expand(prk, b\"context1\", 16)\r\n\r\n``Hkdf`` wrapper class\r\n----------------------\r\n\r\nTo use the wrapper class, instantiate the ``Hkdf()`` class with a salt, input\r\nkey material, and optionally, a hash function. Note that **the default hash function\r\nfor the wrapper class is SHA-256**, which differs from the default for the functional\r\ninterface. You may then call ``expand([info], [length])`` on the Hkdf instance to \r\ngenerate output key material::\r\n\r\n kdf = Hkdf(unhexlify(b\"8e94ef805b93e683ff18\"), b\"asecretpassword\", hash=hashlib.sha512)\r\n key = kdf.expand(b\"context1\", 16)\r\n\r\nChangelog\r\n---------\r\n\r\n- 0.0.3 \u2013 Move documentation from module docstring to README.rst\r\n- 0.0.2 \u2013\u00a0Python 3.3, 3.4 support\r\n- 0.0.1 \u2013\u00a0Initial release\r\n\r\nPlease report any bugs at\r\n\r\n https://www.github.com/casebeer/python-hkdf", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/casebeer/python-hkdf", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "hkdf", "package_url": "https://pypi.org/project/hkdf/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/hkdf/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/casebeer/python-hkdf" }, "release_url": "https://pypi.org/project/hkdf/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)", "version": "0.0.3" }, "last_serial": 1647637, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "cbf958db8db8652ded12dd38de4c99a9", "sha256": "4a8d7c7b18e86af65c8f8c2bf35f957fc43f55f535629e8e294e091dbd672833" }, "downloads": -1, "filename": "hkdf-0.0.1.tar.gz", "has_sig": true, "md5_digest": "cbf958db8db8652ded12dd38de4c99a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3170, "upload_time": "2014-04-10T02:04:51", "url": "https://files.pythonhosted.org/packages/09/a1/5fc5b368c257102ca94672e4eb05a5d4babc156fc30d49046577dbaf1edc/hkdf-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "89cdc882dbcecb9930fdd3a41a850dcd", "sha256": "85e38067e4498caa3b3365990ed00977e831ed43d1d7fff69aa9a78b4d98bbe0" }, "downloads": -1, "filename": "hkdf-0.0.2.tar.gz", "has_sig": true, "md5_digest": "89cdc882dbcecb9930fdd3a41a850dcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3479, "upload_time": "2015-06-16T03:35:45", "url": "https://files.pythonhosted.org/packages/89/c6/963717a6fac2e85a2ca2491ac1824c9598243f96ab1eec005b78622230c7/hkdf-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "d10471ad0ec891cdbe165d78282c943e", "sha256": "622a31c634bc185581530a4b44ffb731ed208acf4614f9c795bdd70e77991dca" }, "downloads": -1, "filename": "hkdf-0.0.3.tar.gz", "has_sig": true, "md5_digest": "d10471ad0ec891cdbe165d78282c943e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3959, "upload_time": "2015-06-16T03:55:40", "url": "https://files.pythonhosted.org/packages/c3/be/327e072850db181ce56afd51e26ec7aa5659b18466c709fa5ea2548c935f/hkdf-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d10471ad0ec891cdbe165d78282c943e", "sha256": "622a31c634bc185581530a4b44ffb731ed208acf4614f9c795bdd70e77991dca" }, "downloads": -1, "filename": "hkdf-0.0.3.tar.gz", "has_sig": true, "md5_digest": "d10471ad0ec891cdbe165d78282c943e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3959, "upload_time": "2015-06-16T03:55:40", "url": "https://files.pythonhosted.org/packages/c3/be/327e072850db181ce56afd51e26ec7aa5659b18466c709fa5ea2548c935f/hkdf-0.0.3.tar.gz" } ] }