-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencrypt
executable file
·36 lines (34 loc) · 1.13 KB
/
encrypt
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
if [ -z "$1" ] && [ -z "$2" ]; then
echo "+-------------+"
echo "| Encrypt 1.0 |"
echo "+-------------+"
echo "Symmetrically encrypts a file."
echo ""
echo "You most enter a parameter, and the file to encrypt."
echo ""
echo "Example:"
echo ""
echo "encrypt -n file-to-encrypt"
echo ""
echo "Additional parameters:"
echo ""
echo "-a Use this to encrypt to an ASCII armored output."
echo "-n Use this to encrypt normally (binary format)."
echo ""
else
if [[ "$1" = "-n" ]]; then
echo "Encrypting normally."
sleep 3
gpg -c -z 9 --require-secmem --cipher-algo AES256 --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 --digest-algo SHA512 --s2k-mode 3 --s2k-count 65000000 --compress-algo BZIP2 --bzip2-compress-level 9 "$2"
# ASCII Armored output
elif [[ "$1" = "-a" ]]; then
echo "Encrypting to ASCII."
sleep 3
gpg -c -z 9 --require-secmem --cipher-algo AES256 --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 --digest-algo SHA512 --s2k-mode 3 --s2k-count 65000000 --armor --compress-algo BZIP2 --bzip2-compress-level 9 "$2"
else
echo ""
echo "Wrong parameter. Use encrypt without parameters for help."
echo ""
fi
fi