{"id":26988405,"url":"https://github.com/rorokimdim/stash","last_synced_at":"2025-04-03T20:19:39.148Z","repository":{"id":160607829,"uuid":"309148534","full_name":"rorokimdim/stash","owner":"rorokimdim","description":"encrypted text storage and cli","archived":false,"fork":false,"pushed_at":"2024-10-24T14:59:38.000Z","size":188,"stargazers_count":41,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-25T17:35:46.006Z","etag":null,"topics":["babashka","cli-tool","haskell"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rorokimdim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-11-01T17:20:25.000Z","updated_at":"2024-10-24T14:59:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"762feb34-5ce8-45fd-94e0-ba13ffb72f63","html_url":"https://github.com/rorokimdim/stash","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fstash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fstash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fstash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fstash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rorokimdim","download_url":"https://codeload.github.com/rorokimdim/stash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070925,"owners_count":20878586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babashka","cli-tool","haskell"],"created_at":"2025-04-03T20:19:38.564Z","updated_at":"2025-04-03T20:19:39.132Z","avatar_url":"https://github.com/rorokimdim.png","language":"Haskell","readme":"# stash\n\n`stash` is a command line program for storing text data in encrypted form.\n\nAll user data is encrypted using [AES 256](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) cipher.\n\nData is hashed for indexing purposes using a good random salt + [SHA512](https://en.wikipedia.org/wiki/SHA-2).\n\n\u003cimg src=\"screenshots/fruits.png\" width=350\u003e\u003c/img\u003e\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --\u003e\n**Table of Contents**\n\n- [stash](#stash)\n    - [Rationale](#rationale)\n    - [Installation](#installation)\n        - [Linux and Mac](#linux-and-mac)\n        - [Others](#others)\n    - [Getting Started](#getting-started)\n    - [Browsing](#browsing)\n        - [Terminal user interface (default)](#terminal-user-interface-default)\n        - [As Org text](#as-org-text)\n        - [As Markdown text](#as-markdown-text)\n    - [Dumping contents to stdout](#dumping-contents-to-stdout)\n        - [As Org text (default)](#as-org-text-default)\n        - [As Markdown text](#as-markdown-text-1)\n        - [As JSON text](#as-json-text)\n    - [Backing up data](#backing-up-data)\n    - [Importing text](#importing-text)\n    - [Babashka pod support](#babashka-pod-support)\n    - [Customization](#customization)\n    - [Shell Autocompletion](#shell-autocompletion)\n        - [bash](#bash)\n        - [zsh](#zsh)\n        - [fish](#fish)\n    - [Credits](#credits)\n\n\u003c!-- markdown-toc end --\u003e\n\n## Rationale\n\nAll of us need to store sensitive information. At the very least, we need to keep passwords and keys to numerous online services we use. Storing them\nin plain-text is risky. So is not keeping backups in multiple locations.\n\n`stash` is an open-source tool to store text in encrypted form. The encrypted data can be stored in untrusted locations without compromising it,\ngranted the encryption-key is unguessable.\n\n## Installation\n\n### Linux and Mac\n\nInstall:\n\n```bash\nbrew install rorokimdim/brew/stash\n```\n\nUpgrade:\n\n```bash\nbrew upgrade stash\n```\n\nUninstall:\n\n```bash\nbrew uninstall stash\n```\n\nBinaries are available at [releases](https://github.com/rorokimdim/stash/releases).\n\n### Others\n\nNo pre-built binaries available at this time. We will need to build from source using `stack install` or `cabal install`.\n\nInstall [stack](https://docs.haskellstack.org/en/stable/README/), clone this repository and run the following in repository directory.\n\n```bash\nstack install\n```\n\n## Getting Started\n\nCreate a stash file.\n\n```\nstash create {path-to-stash-file}\n```\n\nReplace `{path-to-stash-file}` with path to the stash file. For example `~/Dropbox/secret.stash`.\n\nStash will prompt for the encryption-key (password) to use for the file. The key is not saved anywhere, but a\nsalted hash (good random salt + SHA512) of the key and the salt is saved.\n\nWhen we run a stash command, we will be prompted for our encryption key. It is checked against the hash stored during\n`stash create`. For the duration of the command, the encryption key will be used for encrypting/decrypting data.\n\nThe salt stored during `stash create` is also used for hashing any data for indexing purposes.\n\n## Browsing\n\nThis feature does not currently work on windows.\n\n### Terminal user interface (default)\n\n```\nstash browse {path-to-stash-file}\n```\n\n| Shortcuts              | Description                                      |\n|------------------------|--------------------------------------------------|\n| ESC (q)                | Quit                                             |\n| ?                      | Show this help                                   |\n| +                      | Add a new key                                    |\n| \u003e                      | Add a child key to selected key                  |\n| -                      | Delete selected key                              |\n| , (r)                  | Rename selected key                              |\n| /                      | Search and sort by pattern                       |\n| y                      | Copy value of selected key into system clipboard |\n| Enter                  | Set value of selected key                        |\n| H                      | See history of values of selected key            |\n| Left arrow (h)         | Move to parent of selected key                   |\n| Right arrow (l)        | Move to child of selected key                    |\n| Up arrow (k, Ctrl-p)   | Select above                                     |\n| Down arrow (j, Ctrl-n) | Select below                                     |\n| g, G                   | Move to top, Move to bottom                      |\n| Ctrl-u, Ctrl-d         | Scroll keys half page up / down                  |\n| Ctrl-b, Ctrl-f         | Scroll keys one page up / down                   |\n\n### As Org text\n\n```\nstash browse -f org {path-to-stash-file}\n```\n\nOpens as Org text in default editor. Set EDITOR environment variable to your editor command. Defaults to vim.\n\n### As Markdown text\n\n```\nstash browse -f markdown {path-to-stash-file}\n```\n\nOpens as markdown text in default editor. Set EDITOR environment variable to your editor command. Defaults to vim.\n\n\n## Dumping contents to stdout\n\n### As Org text (default)\n\n```\nstash dump -f org {path-to-stash-file}\n```\n\n### As Markdown text\n\n```\nstash dump -f markdown {path-to-stash-file}\n```\n\n### As JSON text\n\n```\nstash dump -f json {path-to-stash-file}\n```\n\n## Backing up data\n\n```\nstash backup {path-to-stash-file}\n```\n\nCreates a timestamped copy of stash file in the same directory as the original file.\n\n## Importing text\n\nWe can import `org` and `markdown` text into stash. This feature is only available in version 0.2.0+.\n\n```\ncat {path-to-text-file} | stash import {path-to-stash-file}\n```\n\n`stash import` will assume text is in `org` format by default, but `markdown` is supported too:\n\n```\ncat {path-to-text-file} | stash import -f markdown {path-to-stash-file}\n```\n\nWe can import from another stash file similarly:\n\n```\nstash dump {path-to-source-stash-file} | stash import {path-to-destination-stash-file}\n```\n\nWe will need to first enter encryption-key for the source stash-file followed by encryption-key for the destination stash file.\n\n## Babashka pod support\n\n`stash` exposes a [bencode](https://en.wikipedia.org/wiki/Bencode) interface using [Babashka Pod Protocol](https://github.com/babashka/pods#the-protocol).\n\nIf you are familiar with [clojure](https://clojure.org/) or [babashka](https://github.com/borkdude/babashka),\nsee [clojure-example](https://github.com/rorokimdim/stash/tree/master/scripting-examples/clojure).\n\nCommon-lisp folks see [common-lisp-example](https://github.com/rorokimdim/stash/tree/master/scripting-examples/common-lisp).\n\nPython folks see [python-example](https://github.com/rorokimdim/stash/tree/master/scripting-examples/python).\n\n## Customization\n\nA few things in stash can be customized via environment variables.\n\n| Name                                | Description                                                                       | Possible Values          | Default          |\n|-------------------------------------|-----------------------------------------------------------------------------------|--------------------------|------------------|\n| `STASH_ENCRYPTION_KEY`              | encryption key                                                                    | -                        | prompt as needed |\n| `STASH_WIPE_CLIPBOARD_AFTER_BROWSE` | wipe clipboard after browse                                                       | true, false              | false            |\n| `STASH_LOG_LEVEL`                   | logging level                                                                     | DEBUG, INFO, WARN, ERROR | INFO             |\n| `STASH_TUI_COLOR_SELECTED`          | color of selected item                                                            | see below                | cyan             |\n| `STASH_TUI_COLOR_CURRENT_PATH`      | color of current path                                                             | see below                | white            |\n| `STASH_TUI_COLOR_SORT_PATTERN`      | color of sort/search text                                                         | see below                | white            |\n| `BABASHKA_POD`                      | start as [babashka-pod](https://github.com/rorokimdim/stash#babashka-pod-support) | true, false              | false            |\n| `EDITOR`                            | command for editing text                                                          | -                        | vim              |\n\nColor values can be one of `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`,\n`white`, `brightBlack`, `brightRed`, `brightGreen`, `brightYellow`,\n`brightBlue`, `brightMagenta`, `brightCyan` and `brightWhite`.\n\n## Shell Autocompletion\n\n### bash\n\n`source` output from following command\n\n```\nstash --bash-completion-script `which stash`\n```\n\n### zsh\n\nCreate a `_stash` in your $FPATH (try `~/.zsh/_stash`) with contents from following command\n\n```\nstash --zsh-completion-script `which stash`\n```\n\n### fish\n\n`source` output from following command\n\n```\nstash --fish-completion-script `which stash`\n```\n\n## Credits\n\n1. [Haskell](https://www.haskell.org/)\n2. [cryptonite](https://github.com/haskell-crypto/cryptonite) and [crypto-simple](https://github.com/Risto-Stevcev/haskell-crypto-simple)\n3. [brick](https://hackage.haskell.org/package/brick) and [optparse-applicative](https://github.com/pcapriotti/optparse-applicative)\n4. All of these [libraries](https://github.com/rorokimdim/stash/blob/master/package.yaml#L20) and all the things they depend on\n5. Every stash file is a [sqlite](https://sqlite.org/) file\n6. Scriping support via [clojure](https://clojure.org/) and [babashka](https://github.com/borkdude/babashka)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frorokimdim%2Fstash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frorokimdim%2Fstash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frorokimdim%2Fstash/lists"}