Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ### VARIABLES ###
- #Places and directories:
- secret=/tmp/secret
- #Random password
- pass=`</dev/urandom tr -dc [:print:] | head -c42`
- ### Program ###
- echo "DISCLAIMER: DO ONLY USE THIS SCRIPT ON A LIVE-CD"
- echo -n "Which file do you wish to encrypt? "
- read -e enc_file
- echo "Encrypting $enc_file using AES256"
- #Use password to encrypt the file
- echo $pass | gpg -c -q --cipher-algo AES256 --passphrase-fd 0 $enc_file
- echo "Done encrypting $enc_file"
- echo "Splitting password into 4 pieces"
- echo "Choose an option:
- 1) Display the secrets on screen
- 2) Save the secrets in a file"
- echo -n "What do you want to do? "
- read -e show
- #Display secrets
- if [ "$show" = "1" ];
- then
- echo $pass | ssss-split -q -t 4 -n 4
- fi
- #Save secrets
- if [ "$show" = "2" ];
- then
- echo $pass | ssss-split -q -t 4 -n 4 > $secret
- echo "Success! Secrets stored at $secret"
- echo -n "Do you want to copy secrets now (y/n)? "
- read -e answer
- if [ "$answer" = "y" ];
- then
- echo -n "Enter location for the copy: "
- read -e loc
- cp $secret $loc
- else
- exit
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement