A basic encryption utility
Project description
Phibes is a utility to keep your secrets (passwords, restore codes, etc.) in an encrypted storage location on your filesystem.
As this is an early work-in-progress, I would discourage the use of it as an actual single-storage of passwords you can't afford to lose.
Installation
At this time, the app isn't available through PyPi, so you'll have to install from github.
Clone the repository and install it in a virtual environment (python 3.8 or later) using pip.
Basic usage
The basic usage command is phibes
. Available subcommands are: init
, status
, delete
, add
, get
, edit
, list
, and remove
.
They each prompt for the file system path to the locker, defaulting to the current working directory.
They each prompt for password, with a repeat for confirmation prompt when initializing the locker.
-
In a command shell, change your working directory to an empty folder where you want your locker to exist.
-
Initialize the locker:
phibes init
You will be prompted for the
crypt_id
. This defaults to the current best available, which you should accept. -
Add an item to the locker:
phibes add
You will be prompted for the item name, and an optional template name.
The template name can be any named item already in your locker. If you provide a valid name, the contents of that item will be used for the initial contents of your new item. If you accept the default, "Empty", you will start with an empty document.
You will not be prompted for
editor
, but you can pass it with the command, e.g.:phibes add --editor vim
You must otherwise have a valid editor set in one of the environment variables
PHIBES_EDITOR
orEDITOR
.After you reply to all the prompts, your configured editor will be launched, and when you save and exit, the contents of the temporary file will be encrypted and stored in a new item in your locker, and the temporary file deleted.
-
Edit an item in the locker:
phibes edit
You will be prompted for an item name. If the item exists in the locker, your editor will be launched with the current content of the item. When you save and exit, the contents of the temporary file will be encrypted and the item in your locker updated, and the temporary file deleted.
-
Report an item in the locker:
phibes get
You will be prompted for an item name. If the item exists in the locker, the contents will be decrypted and reported to the console.
-
Report all items in the locker:
phibes list
You will be prompted for
Verbose
. If you selectverbose
, the full details (including decrypted content) of all items in the locker will be reported. Otherwise, only the names of all items in the locker will be reported. -
Remove an item from the locker:
phibes remove
You will be prompted for an item name. If the item exists in the locker, it will be removed.
-
Report on the locker:
phibes status
The storage location, creation time, and crypt ID will be reported to the console.
-
Delete the locker:
phibes delete
The locker will be deleted.
Advanced usage
The advanced usage command is phibesplus
. Available subcommands are: create
, info
, delete
, create-item
, get-item
, edit
, list
, delete-item
, create-config
, and update-config
.
Advanced usage differs from basic usage in several important ways:
- Lockers have user-assigned names.
- Operations depend on a stored configuration.
- Multiple lockers can be stored in the same configured storage location.
-
Create a configuration
phibesplus create-config
-
Update a configuration
phibesplus update-config
-
Create a locker
phibesplus create
-
Create an item in the locker
phibesplus create-item
-
Edit an item in the locker
phibesplus edit
-
Report an item in the locker
phibesplus get-item
-
Report all items in the locker
phibesplus list
-
Remove an item from the locker
phibesplus delete-item
-
Report on the locker:
phibesplus info
-
Delete the locker:
phibesplus delete
Setup/Config
With your virtual environment activated and phibes installed, you can run the config
command, and be prompted for some requisite details, with some defaults provided.
- location of configuration file [default is user home directory]
- editor [default is from $EDITOR if it is set]
- storage location [default is current working directory]
The file, .phibes.cfg
, is a simple json file that you can also edit directly.
Each time you issue a command, the app will search for a config file as follows:
- path provided as part of the command (
--config
) - user home directory
Editor
In the command-line client, addition/update of Items to a Locker is done by executing the edit
command, which will launch an editor and store the encrypted contents of the file when you save and exit. (Some editors, like Atom, are problematic because they don't block python when they are invoked. I recommend configuring vim, emacs, or nano.)
When you issue the edit command, phibes will attempt to launch the editor you have specified in your config. There is no attempt made to validate that what you've configured is valid prior to this execution.
Storage Path
This will be where the data you add is stored. When you issue a command, the app will use the storage from your configuration file.
When you use the CLI to create a config file, the default storage path is in the directory .phibes
in the user's home directory.
Usage
The command-line interface follows the approach phibes.py <command>
followed by prompts for options. You may also provide these options as part of the command line.
- Create a Locker for all of your Secrets
> ./phibes_cli.py create-locker
You will then be prompted for a locker name and a password. It is crucial to never forget/lose these, as they are irretrievable, and without them, nothing in your Locker will be accessible.
For each of the operations below, you will be prompted for the name and password of the Locker.
- Add a Secret to your Locker
./phibes_cli.py create-item
Your configured editor will be launched with a temporary file. Put your secret information in this file, save, and exit, and the contents will be encrypted and saved as a Secret in your Locker. (The temporary file is immediately deleted.)
- Confirm that your Secret is in your Locker
./phibes_cli.py list
You will be presented a list of the names of all Items in the Locker.
- See the unencrypted contents of your Secret
./phibes_cli.py get-item --item <your item name>
You will be shown your unencrypted Secret. (You can also pass the verbose
parameter to the list
command.)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Phibes-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95981dfd93b8f6c45756d9f4ef676b78b8911f6f5ba1d3b20cc7bc2531e9eac6 |
|
MD5 | b23e10336b10d91a28735aed7d0e6eed |
|
BLAKE2b-256 | b2357bec34e73fdd5b5d597e23cf88c44fbfeadb0ab94dbc44fdd32422abd7d6 |