README.md (2410B)
1 # encrypted diary 2 This collection of simple bash scripts provide an easy way to write confidential notes with strong encryption. It uses asymetric GnuPG for encryption, therefore you can write entries without entering the gpg password. You only have to decrypt (and enter your key-password) when you actually want to read something. 3 4 Hint: Can be combined mit https://github.com/synox/secret-letterbox 5 6 # setup (on osx) 7 * brew install fswatch 8 * install GnuPG (https://gpgtools.org/) 9 * create a new GPG key only for this purpose (choose a strong passphrase!) 10 * add the scripts to your `PATH`. 11 12 # configuration 13 You have to configure some variables with your ``.bash_profile`` (or edit the source files). bash example: 14 15 ```bash 16 export DIARY_KEYID=1234567 17 export DIARY_EDITOR=/Applications/Mou.app/Contents/MacOS/Mou 18 export DIARY_DIRECTORY=/home/joe/diary 19 export DIARY_READER=subl 20 ``` 21 22 fishshell example: 23 24 ```bash 25 set -x DIARY_KEYID 1234567 26 set -x DIARY_EDITOR /Applications/Mou.app/Contents/MacOS/Mou 27 set -x DIARY_DIRECTORY /home/joe/diary 28 set -x DIARY_READER subl 29 ``` 30 31 # usage 32 ## write an entry (add) 33 use ``diary-add`` which reads stdin: 34 35 ```bash 36 echo my first entry | diary-add 37 38 diary-add < notes.html 39 40 diary-add 41 my first entry 42 <CTRL-D> 43 ``` 44 45 `diary-add-hidden` is just like `diary-add`, but without echoing what you type. 46 47 or you can attach a file 48 49 ```bash 50 diary-add /home/john/photo.jpg 51 ``` 52 53 ## edit encrypted entry 54 use ``diary-edit`` to open gpg-file in a fancy text/markdown editor. When saving, the content is automatically encrypted again. 55 56 ```bash 57 diary-edit path/to/file.txt.gpg 58 ``` 59 or use the vim gpg plugin: https://github.com/jamessan/vim-gnupg 60 61 ```bash 62 vi path/to/file.txt.gpg 63 ``` 64 65 ## decrypt one entry console 66 ``diary-print`` simply prints an entry to stdout. 67 68 ```bash 69 diary-print path/to/file.txt.gpg 70 ``` 71 72 ## read all entries 73 ``diary-read-all`` decrypts all entries and prints in $DIARY_READER. It used `gpg2` for to use the gpg-agent on OSX. The implementation can be changed with the environment variable `GPG_CMD`. 74 75 ```bash 76 diary-read-all 77 ``` 78 79 ---- 80 81 ### similar projects 82 There are a few similar projects. I didn't use them because I want the scripts to be short and validatable. 83 84 * https://github.com/matthiasbeyer/diary.sh/ 85 * https://github.com/colinux/GPG-Editor/blob/master/GPG-Editor.sh 86 * https://github.com/almien1/NoPeeking 87 88 Articles: 89 * http://abesto.net/journaling-for-geeks/