ez-crypt-tool


Nameez-crypt-tool JSON
Version 1.0.6 PyPI version JSON
download
home_pagehttps://github.com/damonb123/ez-crypt-tool
SummaryEasily encrypt credentials to use in your application
upload_time2023-01-27 20:36:23
maintainer
docs_urlNone
authordamonb123
requires_python>=3.8
licenseApache-2.0
keywords cryptography security passwords
VCS
bugtrack_url
requirements cryptography rich fernet twine pylint
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Made with Python][7]

[![license][5]][6]
[![Python Supported Version][1]][2]
[![PyPi Package][3]][4]

[1]: https://img.shields.io/badge/python-3.11%3E-blue
[2]: https://www.python.org/downloads/release/python-3111/
[3]: https://img.shields.io/pypi/v/pip.svg
[4]: https://pypi.org/project/pip/
[5]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
[6]: http://www.apache.org/licenses/LICENSE-2.0
[7]: https://forthebadge.com/images/badges/made-with-python.svg
[8]: https://forthebadge.com/images/badges/powered-by-coffee.svg
[9]: https://www.peets.com/products/big-bang

# EZ Crypt Tool for Python

Create and used encryption keys to encrypt any sensitive information used for your application.  Can be used by command line, in environment variables, within Python code as a module.  Simplies the process and makes it easy to kep sensative information safe.

## Operations

___

### Install

```sh
pip install ez-crypt-tool
```

### USE

```sh
ez_crypt_tool
```

| Option | Description |
| ------| -----------|
| --genkey   | Generates a key, that can be used for encryption and decryption. |
| --genkeyfile | Will generate a key and put it in the DEFAULT_KEY_FILE: ~/.ezcrypt/.ezcrypt.key.
| --keyfile:    | Is supplied, will be used for Fernet key. |
| --encrypt: | Uses the key in the KEY_FILES to encrypt a clear text string.|
| --decrypt | Uses the key in the KEY_FILES to decrypt a cipher string. |



KEY_FILES: ['.ezcrypt.key', './conf/.ezcrypt.key', '~/.ezcrypt/.ezcrypt.key']
ENV: Environment can be used, skipping key file.  Example: export EZCRYPT_KEY=<key>

### Step 1:  Generate Key or Key File

```console
ez_crypt_tool --genkey
NQYiJixqOhkFWOESyttUvP4ChIcNehpTiyXMGA0eifA=
```

or

```console
ez_crypt_tool --genkeyfile
NQYiJixqOhkFWOESyttUvP4ChIcNehpTiyXMGA0eifA=
```


### Step 2:  Place key in file

Place the key into the ezcrypt.key file, then put the file in one of the 3 locations listed above in KEY_FILES.

### Step 3: Use command to encrypt password

```console
ez_crypt_tool --encrypt mypassword
Encrypted:gAAAAABi6DbHCEwLiKHIrolX_oUGA9k-3RjB08-5VW0-lg4FdvGgsiwe1HriMkhLfWRFnMJsbJRvmpULEHbu2Q_EQbFDWaPBxA==
```

### Step 4: Store encrypted password

Place encrypted password in configuration file that can be retrieved by the application.

See example under ./sandbox directory.

### Notes

* A prefix of "fenc:<key>" can be prepended to key, to denote encrypted string.  Not required.
* This project uses an example example test key.
* The key file [.ezcrypt.key] is in the conf directory.
* Its only for this example and can be used by others to decyrpt your informaiton.

> !!! DO NOT REUSE THE INCLUDED KEY !!!
> GENERATE A NEW KEY BEFORE USING EzCryptTool in your environment

### Prerequisites  (IMPORTANT)

* Python 3.8.x or greater

* PIP 20.x or greater
* virtualenv 20.14.x or greater

## Code Examples

### EzCryptTool Python Code

___

```python
# Import EzCrypt
from ez_crypt_tool.ez_crypt_tool import EzCryptTool

# Initialize the EzCryptTool
ezc = EzCryptTool.get_instance()

# Starting with clear text string
clear_text_pw = "MyCoolPassword"
print(f"Clear Text: {clear_text_pw}")

# Encrypting the string
crypted_password = ezc.encrypt(clear_text_pw)
print(f"Encrypted: {password}")

# decrypting the string
clear_text_pw = ezc.decrypt(crypted_password)
print(f"Decrypted: {clear_text_pw}")

```

### Output

```console
Clear Text: MyCoolPassword
Encrypted: fenc:gAAAAABjk4vdeenLsvEp_WXKCD_pw2a0oNaSI11l-5WLIdAJH4X579N8GOyYHefEPeR03yJymwoViqba9jBWucKHc4ffoev7Eyyn3O7wx3LmyUqRznut8Cw=
Decrypted: MyCoolPassword
```

## Info and History

___

### History

* Initial upload

### TODO

* [X] Add generate encryption file
* [ ] Add code examples in readme

### Author

* [damonb123@outlook.com](https://github.com/damonb123)

### License

Copyright © 2023, [damonb123](https://github.com/damonb123).
Released under the [APACHE-2.0](LICENSE).

[![Powers by Coffee][8]][9]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/damonb123/ez-crypt-tool",
    "name": "ez-crypt-tool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "cryptography,security,passwords",
    "author": "damonb123",
    "author_email": "damonb123@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/6e/14/0f021944a597e17e11f965dc1545eca786e29cc4d1f45bb44bdc8319596b/ez_crypt_tool-1.0.6.tar.gz",
    "platform": null,
    "description": "![Made with Python][7]\n\n[![license][5]][6]\n[![Python Supported Version][1]][2]\n[![PyPi Package][3]][4]\n\n[1]: https://img.shields.io/badge/python-3.11%3E-blue\n[2]: https://www.python.org/downloads/release/python-3111/\n[3]: https://img.shields.io/pypi/v/pip.svg\n[4]: https://pypi.org/project/pip/\n[5]: https://img.shields.io/badge/License-Apache_2.0-blue.svg\n[6]: http://www.apache.org/licenses/LICENSE-2.0\n[7]: https://forthebadge.com/images/badges/made-with-python.svg\n[8]: https://forthebadge.com/images/badges/powered-by-coffee.svg\n[9]: https://www.peets.com/products/big-bang\n\n# EZ Crypt Tool for Python\n\nCreate and used encryption keys to encrypt any sensitive information used for your application.  Can be used by command line, in environment variables, within Python code as a module.  Simplies the process and makes it easy to kep sensative information safe.\n\n## Operations\n\n___\n\n### Install\n\n```sh\npip install ez-crypt-tool\n```\n\n### USE\n\n```sh\nez_crypt_tool\n```\n\n| Option | Description |\n| ------| -----------|\n| --genkey   | Generates a key, that can be used for encryption and decryption. |\n| --genkeyfile | Will generate a key and put it in the DEFAULT_KEY_FILE: ~/.ezcrypt/.ezcrypt.key.\n| --keyfile:    | Is supplied, will be used for Fernet key. |\n| --encrypt: | Uses the key in the KEY_FILES to encrypt a clear text string.|\n| --decrypt | Uses the key in the KEY_FILES to decrypt a cipher string. |\n\n\n\nKEY_FILES: ['.ezcrypt.key', './conf/.ezcrypt.key', '~/.ezcrypt/.ezcrypt.key']\nENV: Environment can be used, skipping key file.  Example: export EZCRYPT_KEY=<key>\n\n### Step 1:  Generate Key or Key File\n\n```console\nez_crypt_tool --genkey\nNQYiJixqOhkFWOESyttUvP4ChIcNehpTiyXMGA0eifA=\n```\n\nor\n\n```console\nez_crypt_tool --genkeyfile\nNQYiJixqOhkFWOESyttUvP4ChIcNehpTiyXMGA0eifA=\n```\n\n\n### Step 2:  Place key in file\n\nPlace the key into the ezcrypt.key file, then put the file in one of the 3 locations listed above in KEY_FILES.\n\n### Step 3: Use command to encrypt password\n\n```console\nez_crypt_tool --encrypt mypassword\nEncrypted:gAAAAABi6DbHCEwLiKHIrolX_oUGA9k-3RjB08-5VW0-lg4FdvGgsiwe1HriMkhLfWRFnMJsbJRvmpULEHbu2Q_EQbFDWaPBxA==\n```\n\n### Step 4: Store encrypted password\n\nPlace encrypted password in configuration file that can be retrieved by the application.\n\nSee example under ./sandbox directory.\n\n### Notes\n\n* A prefix of \"fenc:<key>\" can be prepended to key, to denote encrypted string.  Not required.\n* This project uses an example example test key.\n* The key file [.ezcrypt.key] is in the conf directory.\n* Its only for this example and can be used by others to decyrpt your informaiton.\n\n> !!! DO NOT REUSE THE INCLUDED KEY !!!\n> GENERATE A NEW KEY BEFORE USING EzCryptTool in your environment\n\n### Prerequisites  (IMPORTANT)\n\n* Python 3.8.x or greater\n\n* PIP 20.x or greater\n* virtualenv 20.14.x or greater\n\n## Code Examples\n\n### EzCryptTool Python Code\n\n___\n\n```python\n# Import EzCrypt\nfrom ez_crypt_tool.ez_crypt_tool import EzCryptTool\n\n# Initialize the EzCryptTool\nezc = EzCryptTool.get_instance()\n\n# Starting with clear text string\nclear_text_pw = \"MyCoolPassword\"\nprint(f\"Clear Text: {clear_text_pw}\")\n\n# Encrypting the string\ncrypted_password = ezc.encrypt(clear_text_pw)\nprint(f\"Encrypted: {password}\")\n\n# decrypting the string\nclear_text_pw = ezc.decrypt(crypted_password)\nprint(f\"Decrypted: {clear_text_pw}\")\n\n```\n\n### Output\n\n```console\nClear Text: MyCoolPassword\nEncrypted: fenc:gAAAAABjk4vdeenLsvEp_WXKCD_pw2a0oNaSI11l-5WLIdAJH4X579N8GOyYHefEPeR03yJymwoViqba9jBWucKHc4ffoev7Eyyn3O7wx3LmyUqRznut8Cw=\nDecrypted: MyCoolPassword\n```\n\n## Info and History\n\n___\n\n### History\n\n* Initial upload\n\n### TODO\n\n* [X] Add generate encryption file\n* [ ] Add code examples in readme\n\n### Author\n\n* [damonb123@outlook.com](https://github.com/damonb123)\n\n### License\n\nCopyright \u00a9 2023, [damonb123](https://github.com/damonb123).\nReleased under the [APACHE-2.0](LICENSE).\n\n[![Powers by Coffee][8]][9]\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Easily encrypt credentials to use in your application",
    "version": "1.0.6",
    "split_keywords": [
        "cryptography",
        "security",
        "passwords"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e140f021944a597e17e11f965dc1545eca786e29cc4d1f45bb44bdc8319596b",
                "md5": "d966acfc099514a8fe443b6bdce014b7",
                "sha256": "a4cad2f6ad20710b67edda0c7fbc63d165c0bba4e1a941817dcb6f1a86f0e43c"
            },
            "downloads": -1,
            "filename": "ez_crypt_tool-1.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "d966acfc099514a8fe443b6bdce014b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11903,
            "upload_time": "2023-01-27T20:36:23",
            "upload_time_iso_8601": "2023-01-27T20:36:23.242672Z",
            "url": "https://files.pythonhosted.org/packages/6e/14/0f021944a597e17e11f965dc1545eca786e29cc4d1f45bb44bdc8319596b/ez_crypt_tool-1.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-27 20:36:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "damonb123",
    "github_project": "ez-crypt-tool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "cryptography",
            "specs": [
                [
                    ">=",
                    "37.0.4"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "12.5.1"
                ]
            ]
        },
        {
            "name": "fernet",
            "specs": [
                [
                    ">=",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "pylint",
            "specs": [
                [
                    ">=",
                    "2.13.9"
                ]
            ]
        }
    ],
    "lcname": "ez-crypt-tool"
}
        
Elapsed time: 0.03278s