{ "info": { "author": "Yggdrash Dev", "author_email": "dev@yggdrash.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# Ethereum Keyfile\n\nA library for handling the encrypted keyfiles used to store ethereum private keys\n\n\n> This library and repository was previously located at https://github.com/pipermerriam/ethereum-keyfile. It was transferred to the Ethereum foundation github in November 2017 and renamed to `eth-keyfile`. The PyPi package was also renamed from `ethereum-keyfile` to `eth-keyfile`.\n\n## Installation\n\n```sh\npip install eth-keyfile\n```\n\n\n## Development\n\n```sh\npip install -e .[dev]\n```\n\n\n### Running the tests\n\nYou can run the tests with:\n\n```sh\npy.test tests\n```\n\nOr you can install `tox` to run the full test suite.\n\n\n### Releasing\n\nPandoc is required for transforming the markdown README to the proper format to\nrender correctly on pypi.\n\nFor Debian-like systems:\n\n```\napt install pandoc\n```\n\nOr on OSX:\n\n```sh\nbrew install pandoc\n```\n\nTo release a new version:\n\n```sh\nmake release bump=$$VERSION_PART_TO_BUMP$$\n```\n\n#### How to bumpversion\n\nThe version format for this repo is `{major}.{minor}.{patch}` for stable, and\n`{major}.{minor}.{patch}-{stage}.{devnum}` for unstable (`stage` can be alpha or beta).\n\nTo issue the next version in line, specify which part to bump,\nlike `make release bump=minor` or `make release bump=devnum`.\n\nIf you are in a beta version, `make release bump=stage` will switch to a stable.\n\nTo issue an unstable version when the current version is stable, specify the\nnew version explicitly, like `make release bump=\"--new-version 2.0.0-alpha.1 devnum\"`\n\n\n## Documentation\n\n### `ygg_keyfile.load_keyfile(path_or_file_obj) --> keyfile_json`\n\nTakes either a filesystem path represented as a string or a file object and\nreturns the parsed keyfile json as a python dictionary.\n\n```python\n>>> from ygg_keyfile import load_keyfile\n>>> load_keyfile('path/to-my-keystore/keystore.json')\n{\n \"crypto\" : {\n \"cipher\" : \"aes-128-ctr\",\n \"cipherparams\" : {\n \"iv\" : \"6087dab2f9fdbbfaddc31a909735c1e6\"\n },\n \"ciphertext\" : \"5318b4d5bcd28de64ee5559e671353e16f075ecae9f99c7a79a38af5f869aa46\",\n \"kdf\" : \"pbkdf2\",\n \"kdfparams\" : {\n \"c\" : 262144,\n \"dklen\" : 32,\n \"prf\" : \"hmac-sha256\",\n \"salt\" : \"ae3cd4e7013836a3df6bd7241b12db061dbe2c6785853cce422d148a624ce0bd\"\n },\n \"mac\" : \"517ead924a9d0dc3124507e3393d175ce3ff7c1e96529c6c555ce9e51205e9b2\"\n },\n \"id\" : \"3198bc9c-6672-5ab3-d995-4942343ae5b6\",\n \"version\" : 3\n}\n```\n\n\n### `ygg_keyfile.create_keyfile_json(private_key, password, kdf=\"pbkdf2\", work_factor=None) --> keyfile_json`\n\nTakes the following parameters:\n\n* `private_key`: A bytestring of length 32\n* `password`: A bytestring which will be the password that can be used to decrypt the resulting keyfile.\n* `kdf`: The key derivation function. Allowed values are `pbkdf2` and `scrypt`. By default, `pbkdf2` will be used.\n* `work_factor`: The work factor which will be used for the given key derivation function. By default `1000000` will be used for `pbkdf2` and `262144` for `scrypt`.\n\nReturns the keyfile json as a python dictionary.\n\n```python\n>>> private_key = b'\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01'\n>>> create_keyfile_json(private_key, b'foo')\n{\n \"address\" : \"1a642f0e3c3af545e7acbd38b07251b3990914f1\",\n \"crypto\" : {\n \"cipher\" : \"aes-128-ctr\",\n \"cipherparams\" : {\n \"iv\" : \"6087dab2f9fdbbfaddc31a909735c1e6\"\n },\n \"ciphertext\" : \"5318b4d5bcd28de64ee5559e671353e16f075ecae9f99c7a79a38af5f869aa46\",\n \"kdf\" : \"pbkdf2\",\n \"kdfparams\" : {\n \"c\" : 262144,\n \"dklen\" : 32,\n \"prf\" : \"hmac-sha256\",\n \"salt\" : \"ae3cd4e7013836a3df6bd7241b12db061dbe2c6785853cce422d148a624ce0bd\"\n },\n \"mac\" : \"517ead924a9d0dc3124507e3393d175ce3ff7c1e96529c6c555ce9e51205e9b2\"\n },\n \"id\" : \"3198bc9c-6672-5ab3-d995-4942343ae5b6\",\n \"version\" : 3\n}\n```\n\n### `ygg_keyfile.decode_keyfile_json(keyfile_json, password) --> private_key`\n\nTakes the keyfile json as a python dictionary and the password for the keyfile,\nreturning the decoded private key.\n\n```python\n>>> keyfile_json = {\n... \"crypto\" : {\n... \"cipher\" : \"aes-128-ctr\",\n... \"cipherparams\" : {\n... \"iv\" : \"6087dab2f9fdbbfaddc31a909735c1e6\"\n... },\n... \"ciphertext\" : \"5318b4d5bcd28de64ee5559e671353e16f075ecae9f99c7a79a38af5f869aa46\",\n... \"kdf\" : \"pbkdf2\",\n... \"kdfparams\" : {\n... \"c\" : 262144,\n... \"dklen\" : 32,\n... \"prf\" : \"hmac-sha256\",\n... \"salt\" : \"ae3cd4e7013836a3df6bd7241b12db061dbe2c6785853cce422d148a624ce0bd\"\n... },\n... \"mac\" : \"517ead924a9d0dc3124507e3393d175ce3ff7c1e96529c6c555ce9e51205e9b2\"\n... },\n... \"id\" : \"3198bc9c-6672-5ab3-d995-4942343ae5b6\",\n... \"version\" : 3\n... }\n>>> decode_keyfile_json(keyfile_json, b'foo')\nb'\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01'\n```\n\n### `ygg_keyfile.extract_key_from_keyfile(path_or_file_obj, password) --> private_key`\n\nTakes a filesystem path represented by a string or a file object and the\npassword for the keyfile. Returns the private key as a bytestring.\n\n```python\n>>> extract_key_from_keyfile('path/to-my-keystore/keyfile.json', b'foo')\nb'\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01'\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yggdrash/ygg-keyfile", "keywords": "ethereum", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ygg-keyfile", "package_url": "https://pypi.org/project/ygg-keyfile/", "platform": "", "project_url": "https://pypi.org/project/ygg-keyfile/", "project_urls": { "Homepage": "https://github.com/yggdrash/ygg-keyfile" }, "release_url": "https://pypi.org/project/ygg-keyfile/0.1.0/", "requires_dist": [ "eth-utils (<2,>=1.3.0)", "eth-keys (<0.3.0,>=0.2.1)", "pycryptodome (<4,>=3.6.6)", "eth-utils (<2,>=1.3.0) ; extra == 'dev'", "eth-keys (<0.3.0,>=0.2.1) ; extra == 'dev'", "pycryptodome (<4,>=3.6.6) ; extra == 'dev'", "bumpversion (<1,>=0.5.3) ; extra == 'dev'", "wheel ; extra == 'dev'", "setuptools (>=36.2.0) ; extra == 'dev'", "pluggy (==0.7.1) ; extra == 'dev'", "idna (==2.7) ; extra == 'dev'", "requests (<3,>=2.20) ; extra == 'dev'", "tox (>=2.7.0) ; extra == 'dev'", "twine ; extra == 'dev'", "pytest (<3.7,>=3.6) ; extra == 'dev'", "flake8 (==3.5.0) ; extra == 'dev'", "eth-utils (<2,>=1.3.0) ; extra == 'keyfile'", "eth-keys (<0.3.0,>=0.2.1) ; extra == 'keyfile'", "pycryptodome (<4,>=3.6.6) ; extra == 'keyfile'", "flake8 (==3.5.0) ; extra == 'lint'", "pytest (<3.7,>=3.6) ; extra == 'test'" ], "requires_python": "", "summary": "A library for handling the encrypted keyfiles used to store yggdrash private keys.", "version": "0.1.0" }, "last_serial": 5877321, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "26ae7162c21846327542889ac45c710b", "sha256": "ce9f345984c541fb06aae2152dd99d4a04d9df48a2424890ad5d1c415c29b486" }, "downloads": -1, "filename": "ygg_keyfile-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "26ae7162c21846327542889ac45c710b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6554, "upload_time": "2019-09-24T03:28:02", "url": "https://files.pythonhosted.org/packages/66/8e/c49da11871ba501bc357bdd3a6fe42448c6013f24a0c1dceeb79c6e14f75/ygg_keyfile-0.1.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "26ae7162c21846327542889ac45c710b", "sha256": "ce9f345984c541fb06aae2152dd99d4a04d9df48a2424890ad5d1c415c29b486" }, "downloads": -1, "filename": "ygg_keyfile-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "26ae7162c21846327542889ac45c710b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6554, "upload_time": "2019-09-24T03:28:02", "url": "https://files.pythonhosted.org/packages/66/8e/c49da11871ba501bc357bdd3a6fe42448c6013f24a0c1dceeb79c6e14f75/ygg_keyfile-0.1.0-py3-none-any.whl" } ] }