/bashcrypto

Bash script to encrypt and decrypt files

Primary LanguageShell

bashcrypto

Usage

Options

Usage: bashcrypt [OPTION] -i INPUT -o OUTPUT
-p	use public/privatekey for encryption/decryption
-e	encrypt
-d	decrypt
-i	input
-o	output
-s	create shasum
-t  tarmode
-h	help message

Create public/private key

# Create public/private key
openssl req -x509 -nodes -newkey rsa:4096 -keyout privatekey.pem -out publickey.pem
# Create public/private key with password protection
openssl req -x509 -newkey rsa:4096 -keyout privatekey.pem -out publickey.pem

Encrypt

# encrypt with a password:
./bashcrypto -e -i test.txt -o test.txt.enc
# encrypt all files in a folder
./bashcrypto -e -i dir -o enc
# encrypt with your public key:
./bashcrypto -e -p public.pem -i test.txt -o ultrasecret.dat
# encrypt all files in a folder
./bashcrypto -e -p public.pem -i dir -o ultrasecret.dat

Decrypt

# decrypt with password:
./bashcrypto -d -i test.txt.enc -o plain.txt
# decrypt with private key:
./bashcrypto -d -p private.pem -i ultrasecret.dat -o plain.txt

To-Do

  • ?