Advertisement
Guest User

Untitled

a guest
Nov 24th, 2010
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ### VARIABLES ###
  4.  
  5. #Places and directories:
  6. secret=/tmp/secret
  7. #Random password
  8. pass=`</dev/urandom tr -dc [:print:] | head -c42`
  9.  
  10. ### Program ###
  11. echo "DISCLAIMER: DO ONLY USE THIS SCRIPT ON A LIVE-CD"
  12. echo -n "Which file do you wish to encrypt? "
  13. read -e enc_file
  14. echo "Encrypting $enc_file using AES256"
  15. #Use password to encrypt the file
  16. echo $pass | gpg -c -q --cipher-algo AES256 --passphrase-fd 0 $enc_file
  17. echo "Done encrypting $enc_file"
  18. echo "Splitting password into 4 pieces"
  19. echo "Choose an option:
  20. 1) Display the secrets on screen
  21. 2) Save the secrets in a file"
  22. echo -n "What do you want to do? "
  23. read -e show
  24. #Display secrets
  25. if [ "$show" = "1" ];
  26.  then
  27.   echo $pass | ssss-split -q -t 4 -n 4
  28. fi
  29. #Save secrets
  30. if [ "$show" = "2" ];
  31.  then
  32.   echo $pass | ssss-split -q -t 4 -n 4 > $secret
  33.   echo "Success! Secrets stored at $secret"
  34.   echo -n "Do you want to copy secrets now (y/n)? "
  35.   read -e answer
  36.    if [ "$answer" = "y" ];
  37.     then
  38.      echo -n "Enter location for the copy: "
  39.      read -e loc
  40.      cp $secret $loc
  41.    else
  42.   exit
  43. fi
  44. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement