{"id":25597132,"url":"https://github.com/tleonardi/vault.sh","last_synced_at":"2025-04-13T03:09:20.750Z","repository":{"id":75102447,"uuid":"113198442","full_name":"tleonardi/vault.sh","owner":"tleonardi","description":"An interactive bash script that simplifies the management of gpg encrypted files","archived":false,"fork":false,"pushed_at":"2024-06-13T08:29:40.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T03:08:59.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tleonardi.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,"publiccode":null,"codemeta":null}},"created_at":"2017-12-05T15:20:42.000Z","updated_at":"2024-06-13T08:29:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"96b3a195-75d5-4097-9198-162bdf0bc16d","html_url":"https://github.com/tleonardi/vault.sh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleonardi%2Fvault.sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleonardi%2Fvault.sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleonardi%2Fvault.sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleonardi%2Fvault.sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tleonardi","download_url":"https://codeload.github.com/tleonardi/vault.sh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657918,"owners_count":21140846,"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":[],"created_at":"2025-02-21T12:47:52.613Z","updated_at":"2025-04-13T03:09:20.717Z","avatar_url":"https://github.com/tleonardi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vault.sh\n\n_Vault is a simple interactive bash script that simplifies the management of gpg encrypted files._\n\n`vault` decrypts [gpg](http://www.gnupg.org) files to a specified folder (the vault) and indexes them for later re-encryption.\nAfter working on the decrypted files inside the vault, `vault` scans the indexed files, re-encrypts them and moves them back to their original location. `vault` can detect if the encrypted file was modified after decryption (e.g. manually by the user or by another program), and prompts the user before overwriting it.\n\nA typical use case is to store sensitive data as encrypted files in the cloud and use `vault` to decrypt them to a local folder and put them back in the cloud after working on them.\n\n## Features\n* Simple interface\n* Strong crypto (asymmetric encryption via gpg)\n* Minimal dependecies (gpg, coreutils)\n* Fast\n\n## Examples\n\n```ShellSession\n\ntom@local ~ $ vault -h\n\nvault simplifies encryption and decryption of files to a vault.\n\nUsage: vault [OPTIONS] filename(s)\n\n  -d       Decrypts the file to the vault and optionally makes \n           an index to re-encrypt it and copy it back to its\n\t   original location.\n  -e       Re-encrypt indexed files in the vault and copy them\n           to their original location.\n  -p       Path of the vault. Deafults to $VAULT if set, other-\n           wise $HOME/vault\n  -k       GPG key to use to encrypt the files. If not provided\n           uses $VAULT_KEY (if set) or the gpg option\n\t   --default-recipient-self.\n  -q       Run non-interactively (automatically overwrites)\n  -v       Print version\n  -h\t   Print this help message\n```\n\n\n\n### Decrypting a secret file\n```ShellSession\ntom@local ~/secret_files $ ls\nsecret.gpg\n \ntom@local ~/secret_files $ vault secret.gpg \ngpg: encrypted with 2048-bit RSA key, ID 0xXXXXXXXX, created 2000-01-01\n      \"Tommaso Leonardi \u003ctom@itm6.xyz\u003e\"\nThe file was decrypted to the vault: ~/vault/secret\n\n1) Delete it\n2) Add to Index for later re-encryption (default)\n3) Leave it\n2\ntom@local ~/secret_files $ ls ~/vault\nsecret\n```\n\n### Re-encrypting a secret file\n```ShellSession\n\ntom@local ~/secret_files $ ls ~/vault\nsecret\n\ntom@local ~/secret_files $ cat ~/vault/secret\nThis is my secret\n\ntom@local ~/secret_files $ echo \"My new secret\" \u003e ~/vault/secret\n\ntom@local ~/secret_files $ vault -e\nProcessing file: secret\n\tDo you want to overwrite ~/secret_files/secret.gpg?(Y/n) \nY\ngpg: using \"0xXXXXXXXXX\" as default secret key for signing\n\tDo you want to delete the unencrypted file ~/vault/secret and its index?(Y/n) \nY\ntom@local ~/secret_files $ ls ~/vault\ntom@local ~/secret_files $\n```\n\n### Re-encrypting after modifying the original file\n```ShellSession\n\ntom@local ~/secret_files $ ls\nsecret.gpg\n \ntom@local ~/secret_files $ vault secret.gpg \ngpg: encrypted with 2048-bit RSA key, ID 0xXXXXXXXX, created 2000-01-01\n      \"Tommaso Leonardi \u003ctom@itm6.xyz\u003e\"\nThe file was decrypted to the vault: ~/vault/secret\n\n1) Delete it\n2) Add to Index for later re-encryption (default)\n3) Leave it\n2\ntom@local ~/secret_files $ ls ~/vault\nsecret\ntom@local ~/secret_files $ echo \"Original file changed\" \u003e ~/secret_files/secret.gpg\n\ntom@local ~/secret_files $ vault -e\nProcessing file: secret\n\t## The original file has been modified after decryption! ##\n\tDo you want to overwrite ~/secret_files/secret.gpg?(Y/n) \nn\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleonardi%2Fvault.sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftleonardi%2Fvault.sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleonardi%2Fvault.sh/lists"}