json-keystore


Namejson-keystore JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/brianddk/json-keystore
SummaryPython Library for Encrypted JSON
upload_time2024-05-02 23:28:01
maintainerNone
docs_urlNone
authorbrianddk
requires_python>=3.8.2
licenseApache-2.0
keywords json encryption
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # json-keystore

[![PyPI version](https://badge.fury.io/py/json-keystore.svg)](https://badge.fury.io/py/json-keystore)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/license/apache-2-0/)
[![GitHub](https://img.shields.io/badge/GitHub-Repo-blue.svg)](https://github.com/brianddk/json-keystore)
[![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-blue.svg)](https://github.com/brianddk/json-keystore/discussions)
[![Donate with Bitcoin Lightning](https://img.shields.io/badge/Donate-Lightning-yellow.svg)](https://tippin.me/@dkbriand)
[![Donate with Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](https://mempool.space/address/bc1qwc2203uym96u0nmq04pcgqfs9ldqz9l3mz8fpj)

***EARLY PREVIEW RELEASE*** of a rudimentary python library for encrypted JSON

## Future Plans

- [ ] Add [AES encryption][n], or port samples to [CryptoDomeX][o]

## Install and Initial Setup

This utility allows you to set up an encrypted JSON keystore that supports both GPG and Trezor-CipherKeyValue encryption.  You will need either a GPG key pair installed, or a Trezor attached.  As a fallback you can store data in naked JSON, but that is obviously not recommended.

### Install with Debug support

If you want to debug one of the client calls or step into a [trezorlib][j] call, you can install from GIT sources.  Then you can add breakpoints in source using calls to `breakpoint()` to get more detailed information.

1. Get source: `git clone https://github.com/brianddk/json-keystore.git`
2. Switch directories: `cd json-keystore`
3. Upgrade setuptools: `python -m pip install --upgrade setuptools pip wheel`
3. Install develop mode via pip: `pip install -e .`
4. Verify install: `python -c "import json_keystore"`
5. Optionally add `breakpoint()` into one of the `*.py` files
6. Optionally step through code in the python debugger (`pdb`)

### Install without GIT

To install the most recent edition directly from GitHub tarball:

```
python -m pip install --upgrade setuptools pip wheel
python -m pip install git+https://github.com/brianddk/json-keystore.git
```

You won't get to documentation or templates, but all the code will land and function

### Install last release from PIP

1. Upgrade: `python -m pip install --upgrade setuptools pip wheel`
2. Install: `pip install json-keystore`
2. Verify install: `python -c "import json_keystore"`

## Building a Keystore

Template keystores are provided in the [templates][v] directory.  If you decide to use a naked JSON, you can simply modify the `null` values in the `json_ks.json` to fill in the key values.  If you want to use encryption you will need to modify on of the encryption templates (`trezor_ks.json` or `gnupg_ks.json`) and update the unencrypted parameters.  These all deal with various encryption settings.  Note that for Trezor, `zlib` is the ONLY supported compression.  Since the JSON keystore is self explanatory, I'll focus on building the encrypted keystores.

### Building a GnuPG encrypted Keystore:

Start with the GnuPG template `gnupg_ks.json`, and change the recipient to the key-id of your GnuPG key.  This can be the UID (email), or the short or long key hex.

```
{
  "format": "gnupg",
  "gnupg": {
    "recipient": "TYPE_YOUR_GPG_PUBLIC_KEY_HERE"
  }
}
```


<!-- Link Nest -->

[a]: https://docs.cloud.coinbase.com/sign-in-with-coinbase (api v2)
[b]: https://docs.cloud.coinbase.com/advanced-trade-api (api v3)
[c]: https://github.com/coinbase/coinbase-python/blob/master/README.rst#usage (client v2)
[d]: https://coinbase.github.io/coinbase-advanced-py/coinbase.rest.html#module-coinbase.rest.accounts (client v3)
[e]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-users#show-authorization-information
[f]: https://github.com/coinbase/coinbase-python#usage
[g]: https://github.com/Kijewski/pyjson5 (JSON5)
[h]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#oauth2
[i]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#api-key--secret
[j]: https://pypi.org/project/trezor/
[k]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#usage
[l]: https://coinbase.github.io/coinbase-advanced-py/coinbase.rest.html#restclient-constructor
[m]: https://coinbase.github.io/coinbase-advanced-py/index.html
[n]: https://stackoverflow.com/a/21928790/4634229
[o]: https://stackoverflow.com/a/48175912/4634229
[p]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#market-data
[q]: https://github.com/coinbase/coinbase-python/ (coinbase-python)
[r]: https://github.com/coinbase/coinbase-advanced-py (coinbase-advanced-py)
[s]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/changelog#2024-apr-02 (april-2nd)
[t]: https://portal.cloud.coinbase.com/access/api?keyType=trade&referrer=advanced_trade (v3-api-keys)
[u]: https://www.coinbase.com/settings/api (oauth2-api-keys)
[v]: templates
[w]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/welcome (siwc-spec)
[x]: https://docs.cloud.coinbase.com/advanced-trade-api/docs/welcome (at-spec)
[y]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#usage (v2-lib-doc)
[z]: https://coinbase.github.io/coinbase-advanced-py/ (v3-lib-doc)
[0]: https://docs.python.org/3.12/tutorial/index.html (py3-tutorial)




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/brianddk/json-keystore",
    "name": "json-keystore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.2",
    "maintainer_email": "brianddk <brianddk@users.noreply.github.com>",
    "keywords": "json, encryption",
    "author": "brianddk",
    "author_email": "brianddk <brianddk@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/16/4d/354cf86fcef7eb751f4d3577176504e2d81c7801179b47d6b397867a268d/json_keystore-0.0.1.tar.gz",
    "platform": null,
    "description": "# json-keystore\r\n\r\n[![PyPI version](https://badge.fury.io/py/json-keystore.svg)](https://badge.fury.io/py/json-keystore)\r\n[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/license/apache-2-0/)\r\n[![GitHub](https://img.shields.io/badge/GitHub-Repo-blue.svg)](https://github.com/brianddk/json-keystore)\r\n[![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-blue.svg)](https://github.com/brianddk/json-keystore/discussions)\r\n[![Donate with Bitcoin Lightning](https://img.shields.io/badge/Donate-Lightning-yellow.svg)](https://tippin.me/@dkbriand)\r\n[![Donate with Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](https://mempool.space/address/bc1qwc2203uym96u0nmq04pcgqfs9ldqz9l3mz8fpj)\r\n\r\n***EARLY PREVIEW RELEASE*** of a rudimentary python library for encrypted JSON\r\n\r\n## Future Plans\r\n\r\n- [ ] Add [AES encryption][n], or port samples to [CryptoDomeX][o]\r\n\r\n## Install and Initial Setup\r\n\r\nThis utility allows you to set up an encrypted JSON keystore that supports both GPG and Trezor-CipherKeyValue encryption.  You will need either a GPG key pair installed, or a Trezor attached.  As a fallback you can store data in naked JSON, but that is obviously not recommended.\r\n\r\n### Install with Debug support\r\n\r\nIf you want to debug one of the client calls or step into a [trezorlib][j] call, you can install from GIT sources.  Then you can add breakpoints in source using calls to `breakpoint()` to get more detailed information.\r\n\r\n1. Get source: `git clone https://github.com/brianddk/json-keystore.git`\r\n2. Switch directories: `cd json-keystore`\r\n3. Upgrade setuptools: `python -m pip install --upgrade setuptools pip wheel`\r\n3. Install develop mode via pip: `pip install -e .`\r\n4. Verify install: `python -c \"import json_keystore\"`\r\n5. Optionally add `breakpoint()` into one of the `*.py` files\r\n6. Optionally step through code in the python debugger (`pdb`)\r\n\r\n### Install without GIT\r\n\r\nTo install the most recent edition directly from GitHub tarball:\r\n\r\n```\r\npython -m pip install --upgrade setuptools pip wheel\r\npython -m pip install git+https://github.com/brianddk/json-keystore.git\r\n```\r\n\r\nYou won't get to documentation or templates, but all the code will land and function\r\n\r\n### Install last release from PIP\r\n\r\n1. Upgrade: `python -m pip install --upgrade setuptools pip wheel`\r\n2. Install: `pip install json-keystore`\r\n2. Verify install: `python -c \"import json_keystore\"`\r\n\r\n## Building a Keystore\r\n\r\nTemplate keystores are provided in the [templates][v] directory.  If you decide to use a naked JSON, you can simply modify the `null` values in the `json_ks.json` to fill in the key values.  If you want to use encryption you will need to modify on of the encryption templates (`trezor_ks.json` or `gnupg_ks.json`) and update the unencrypted parameters.  These all deal with various encryption settings.  Note that for Trezor, `zlib` is the ONLY supported compression.  Since the JSON keystore is self explanatory, I'll focus on building the encrypted keystores.\r\n\r\n### Building a GnuPG encrypted Keystore:\r\n\r\nStart with the GnuPG template `gnupg_ks.json`, and change the recipient to the key-id of your GnuPG key.  This can be the UID (email), or the short or long key hex.\r\n\r\n```\r\n{\r\n  \"format\": \"gnupg\",\r\n  \"gnupg\": {\r\n    \"recipient\": \"TYPE_YOUR_GPG_PUBLIC_KEY_HERE\"\r\n  }\r\n}\r\n```\r\n\r\n\r\n<!-- Link Nest -->\r\n\r\n[a]: https://docs.cloud.coinbase.com/sign-in-with-coinbase (api v2)\r\n[b]: https://docs.cloud.coinbase.com/advanced-trade-api (api v3)\r\n[c]: https://github.com/coinbase/coinbase-python/blob/master/README.rst#usage (client v2)\r\n[d]: https://coinbase.github.io/coinbase-advanced-py/coinbase.rest.html#module-coinbase.rest.accounts (client v3)\r\n[e]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-users#show-authorization-information\r\n[f]: https://github.com/coinbase/coinbase-python#usage\r\n[g]: https://github.com/Kijewski/pyjson5 (JSON5)\r\n[h]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#oauth2\r\n[i]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#api-key--secret\r\n[j]: https://pypi.org/project/trezor/\r\n[k]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#usage\r\n[l]: https://coinbase.github.io/coinbase-advanced-py/coinbase.rest.html#restclient-constructor\r\n[m]: https://coinbase.github.io/coinbase-advanced-py/index.html\r\n[n]: https://stackoverflow.com/a/21928790/4634229\r\n[o]: https://stackoverflow.com/a/48175912/4634229\r\n[p]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#market-data\r\n[q]: https://github.com/coinbase/coinbase-python/ (coinbase-python)\r\n[r]: https://github.com/coinbase/coinbase-advanced-py (coinbase-advanced-py)\r\n[s]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/changelog#2024-apr-02 (april-2nd)\r\n[t]: https://portal.cloud.coinbase.com/access/api?keyType=trade&referrer=advanced_trade (v3-api-keys)\r\n[u]: https://www.coinbase.com/settings/api (oauth2-api-keys)\r\n[v]: templates\r\n[w]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/welcome (siwc-spec)\r\n[x]: https://docs.cloud.coinbase.com/advanced-trade-api/docs/welcome (at-spec)\r\n[y]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#usage (v2-lib-doc)\r\n[z]: https://coinbase.github.io/coinbase-advanced-py/ (v3-lib-doc)\r\n[0]: https://docs.python.org/3.12/tutorial/index.html (py3-tutorial)\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Python Library for Encrypted JSON",
    "version": "0.0.1",
    "project_urls": {
        "Discussions": "https://github.com/brianddk/json-keystore/discussions",
        "Donations": "https://tippin.me/@dkbriand",
        "Homepage": "https://github.com/brianddk/json-keystore",
        "Issues": "https://github.com/brianddk/json-keystore/issues",
        "Repository": "https://github.com/brianddk/json-keystore.git"
    },
    "split_keywords": [
        "json",
        " encryption"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c5ada6f649b7ca044a83da6122aa96ab813f2110b26c1db3c6acde43b883cc2",
                "md5": "0ff0eedc7dfe36afdcbc6f615653e3b2",
                "sha256": "310b771c5d24a2fc1e1e6f709165f20e9b1fe572c87d6b8b4718db49773388d3"
            },
            "downloads": -1,
            "filename": "json_keystore-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ff0eedc7dfe36afdcbc6f615653e3b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.2",
            "size": 10535,
            "upload_time": "2024-05-02T23:27:59",
            "upload_time_iso_8601": "2024-05-02T23:27:59.784752Z",
            "url": "https://files.pythonhosted.org/packages/3c/5a/da6f649b7ca044a83da6122aa96ab813f2110b26c1db3c6acde43b883cc2/json_keystore-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "164d354cf86fcef7eb751f4d3577176504e2d81c7801179b47d6b397867a268d",
                "md5": "700e1414d29a3c397a44774ea7462d8e",
                "sha256": "90efb46dc5fa7b54a896d7bb8004104bf5eea48c09ba3e22a6c1bccec5a6ec2b"
            },
            "downloads": -1,
            "filename": "json_keystore-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "700e1414d29a3c397a44774ea7462d8e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.2",
            "size": 11145,
            "upload_time": "2024-05-02T23:28:01",
            "upload_time_iso_8601": "2024-05-02T23:28:01.835237Z",
            "url": "https://files.pythonhosted.org/packages/16/4d/354cf86fcef7eb751f4d3577176504e2d81c7801179b47d6b397867a268d/json_keystore-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 23:28:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "brianddk",
    "github_project": "json-keystore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "json-keystore"
}
        
Elapsed time: 0.24919s