-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpgit
executable file
·36 lines (27 loc) · 1.03 KB
/
gpgit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# GPGit
#
# Linux bash script to strengthen symmetric file encryption by GnuPG.
#
# Usage: gpgit <filename> [-c]
#
# -c to apply cascade encryption
#
# Author: Martin Latter, 23/03/2016, 18/10/2016
# Version: 0.14
# License: GNU GPL version 3.0 (GPL v3); http://www.gnu.org/licenses/gpl.html
# Link: https://github.com/Tinram/GPGit.git
if [ "$#" -lt 1 ] || [ "$1" == "-c" ] ; then
echo "usage: gpgit <filename> [-c]"
exit 1
fi
FILENAME="$1"
CASCADE="$2"
# can use either gpg or gpg2
# replace 'gpg' with 'gpg2' below if gpg2 is available
gpg -c --s2k-mode 3 --s2k-count 65011712 --s2k-digest-algo SHA512 --cipher-algo AES256 --require-secmem -z 9 "$FILENAME"
# cascade encryption: two passphrases required, take the resulting <filename>.gpg.gpg file
if [ "$CASCADE" == "-c" ]; then
echo "applying cascade encryption: second password required ..."
gpg -c --s2k-mode 3 --s2k-count 65011712 --s2k-digest-algo SHA512 --cipher-algo TWOFISH --require-secmem -z 9 "$FILENAME.gpg"
fi