{ "info": { "author": "Will Breaden Madden", "author_email": "wbm@protonmail.ch", "bugtrack_url": null, "classifiers": [], "description": "william\\_blake\\_crypto\n======================\n\n.. figure:: https://raw.githubusercontent.com/wdbm/william_blake_crypto/master/william_blake_crypto.png\n :alt: \n\nThis package can\n\n- convert a YAML object to an encrypted string object and back,\n- convert a YAML file to an encrypted file and back,\n- decrypt an encrypted file to a YAML object,\n- and can generate, input and load a key for these purposes.\n\nThis package should be used in addition to other security measures, such\nas running it on an operating system with an encrypted partition (e.g.\necryptfs, LUKS) and with SSH passcode access disabled.\n\nUsing this module, a key should be generated and saved securely.\n\nIn production, robust security is assumed to be required, so a script\nusing this package can request the key as a *manual input* that is\nprovided by the user when the script is launched and then the script can\nuse this key, which exists solely in the volatile memory associated with\nthe script, to decrypt an encrypted file to a YAML object; for example,\nan encrypted configuration file.\n\nIn development, a key can be generated and saved to a file such as\n``~/.config/william_blake_crypto/key`` which can be loaded by the\npackage without the need for manual input, but this is not a secure\napproach so should be used only for development, not production.\n\nsetup\n=====\n\n.. code:: bash\n\n pip install william_blake_crypto\n\ngenerate key\n============\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.generate_key()\n b'rojTAcN-Tjy6W43BUozbFIhIA2jq076KysjUj8l8N4E='\n\nSo, for production, this key could be saved to a file such as\n``~/.config/william_blake_crypto/key``. The exact contents of the file\nin this example would be as follows:\n\n::\n\n rojTAcN-Tjy6W43BUozbFIhIA2jq076KysjUj8l8N4E=\n\ninput key (for production)\n==========================\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.input_key()\n key: \n >>> wbc._key\n b'rojTAcN-Tjy6W43BUozbFIhIA2jq076KysjUj8l8N4E='\n\nThe idea is that this key is stored securely (perhaps in a VeraCrypt\nvolume file) and copy-pasted into the terminal in which the script is\nlaunched when the key is requested. This ensures that the key exists\nonly in the volatile memory associated with the running script, and is\nnot accessible as a plaintext file (which would be viewable by a\ncracker).\n\nload key (for development)\n==========================\n\nFor development, generate a key (as described above) and save it to a\nfile such as ``~/.config/william_blake_crypto/key``, which is the\ndefault location for this key *which is intended for development use\nonly* (though the path of this key can be specified as an argument for\nthe function ``load_key``.\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.load_key()\n >>> wbc._key\n b'rojTAcN-Tjy6W43BUozbFIhIA2jq076KysjUj8l8N4E='\n\nencrypting and decrypting YAML objects\n======================================\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.load_key()\n >>> config = {\"passcode\": 12345}\n >>> token = wbc.encrypt_yaml(content=config)\n >>> token\n b'gAAAAABbhGbVUVbbneKoz7wvV8aOF9K6r1hSNQvDexfAflIML33iyNa_Nf7Nm6g6syIXBkyANTHw3RlGMIsCgDligdts78a6VxrBaxbOIhGqSkzNtA5GDK4='\n >>> wbc.decrypt_yaml(token=token)\n {'passcode': 12345}\n\nconverting a YAML file to an encrypted YAML file and decrypting it\n==================================================================\n\n.. code:: bash\n\n $ echo \"{'passcode': 12345}\" > test.yaml\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.load_key()\n >>> wbc.yaml_file_to_encrypted_file(filepath_yaml=\"test.yaml\", filepath_encrypted=\"test.cyaml\")\n\n.. code:: bash\n\n $ cat test.cyaml \n b'gAAAAABbhGzog6kLduLbflVx49jUD6WmIuRw8h0V7X25LrW6LnKjxbLN0pE7jMMeY9qaeGysjLsz-XA8EZ_LQVGslXhicpxLtt9K0CYFFYv2UZ3XEDt8oEI='\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.load_key()\n >>> config = wbc.encrypted_file_to_yaml(filepath=\"test.cyaml\")\n >>> config\n {'passcode': 12345}\n\nconverting an encrypted YAML file to a YAML file\n================================================\n\n.. code:: python\n\n >>> import william_blake_crypto as wbc\n >>> wbc.load_key()\n >>> wbc.encrypted_file_to_yaml_file(filepath_yaml=\"test2.yaml\", filepath_encrypted=\"test.cyaml\")\n\n.. code:: bash\n\n $ cat test2.yaml \n {passcode: 12345}\n\nfuture\n======\n\nUnder consideration are ways to use time-based one-time passcodes (TOTP)\nin place of a static key, perhaps using\n`che\\_guevara\\_otp `__.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wdbm/william_blake_crypto", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "william_blake_crypto", "package_url": "https://pypi.org/project/william_blake_crypto/", "platform": "", "project_url": "https://pypi.org/project/william_blake_crypto/", "project_urls": { "Homepage": "https://github.com/wdbm/william_blake_crypto" }, "release_url": "https://pypi.org/project/william_blake_crypto/2019.4.3.617/", "requires_dist": null, "requires_python": "", "summary": "cryptography library", "version": "2019.4.3.617" }, "last_serial": 5086418, "releases": { "2018.8.27.2215": [ { "comment_text": "", "digests": { "md5": "7df03af45517c083d4fb61007ac5513f", "sha256": "08021d2bb43398d2b353ac84f6e30a26955deaf72e40334af94e13a77ec96f09" }, "downloads": -1, "filename": "william_blake_crypto-2018.8.27.2215.tar.gz", "has_sig": false, "md5_digest": "7df03af45517c083d4fb61007ac5513f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4023, "upload_time": "2018-08-27T22:35:34", "url": "https://files.pythonhosted.org/packages/3e/9a/4f5c7e1228c0422b122db6504b6f7723a7f89706b6be9553ef83c7c1856c/william_blake_crypto-2018.8.27.2215.tar.gz" } ], "2019.1.15.1515": [ { "comment_text": "", "digests": { "md5": "ae2976bbd15570823140855f393c73a5", "sha256": "1afd09495614b5af35decc2d424ef73ee9bd891949a48f0c69d14b814a2340de" }, "downloads": -1, "filename": "william_blake_crypto-2019.1.15.1515.tar.gz", "has_sig": false, "md5_digest": "ae2976bbd15570823140855f393c73a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4518, "upload_time": "2019-01-15T15:16:39", "url": "https://files.pythonhosted.org/packages/97/a5/771f397dffab06337b9ed5e71881390e1d38fe3d740fffc468c0a8f16099/william_blake_crypto-2019.1.15.1515.tar.gz" } ], "2019.1.24.405": [ { "comment_text": "", "digests": { "md5": "328b409a296853b6e5fea949e6793162", "sha256": "d770e88a2289dc85c1c1998da523fee1838eb049c8bf9b583ad0e8e2c722ebe0" }, "downloads": -1, "filename": "william_blake_crypto-2019.1.24.405.tar.gz", "has_sig": false, "md5_digest": "328b409a296853b6e5fea949e6793162", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4672, "upload_time": "2019-01-24T04:08:45", "url": "https://files.pythonhosted.org/packages/46/fc/81511155d30f80d0021c1468509b0a640daff40cccacb8f34ae0bebccc7d/william_blake_crypto-2019.1.24.405.tar.gz" } ], "2019.4.3.617": [ { "comment_text": "", "digests": { "md5": "0313abbc1257185111d6aa8c442099e1", "sha256": "356f9abf39eae9e576c9df3afc0bd367ebc81d1910fa9662ff4985fd8c72afc7" }, "downloads": -1, "filename": "william_blake_crypto-2019.4.3.617.tar.gz", "has_sig": false, "md5_digest": "0313abbc1257185111d6aa8c442099e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4681, "upload_time": "2019-04-03T06:19:07", "url": "https://files.pythonhosted.org/packages/36/81/d210e0a67a04de4d27117dcc7631a21004d4cdb35e016e1cfbdd0fc15cd0/william_blake_crypto-2019.4.3.617.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0313abbc1257185111d6aa8c442099e1", "sha256": "356f9abf39eae9e576c9df3afc0bd367ebc81d1910fa9662ff4985fd8c72afc7" }, "downloads": -1, "filename": "william_blake_crypto-2019.4.3.617.tar.gz", "has_sig": false, "md5_digest": "0313abbc1257185111d6aa8c442099e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4681, "upload_time": "2019-04-03T06:19:07", "url": "https://files.pythonhosted.org/packages/36/81/d210e0a67a04de4d27117dcc7631a21004d4cdb35e016e1cfbdd0fc15cd0/william_blake_crypto-2019.4.3.617.tar.gz" } ] }