commit e68400ebc953729f493d6a743d604151ee5fbacf Author: PrincessPi3 Date: Thu Sep 12 04:56:50 2024 -0600 initial commit diff --git a/COPYING.txt b/COPYING.txt new file mode 100644 index 0000000..ee8c1e9 --- /dev/null +++ b/COPYING.txt @@ -0,0 +1,4 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/README.md b/README.md new file mode 100644 index 0000000..980ea84 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# hiddencrypto +Silly lil script for using [scrypt](https://github.com/Tarsnap/scrypt), [secure-delete (srm)](https://github.com/BlackArch/secure-delete), and tar to open and close an encrypted (scrypt) and compressed (bz2) and shred (srm) any lingering data immediately. + +## Back up your shit +* This script is probably as unstable as I am and will probably end up nuking your files +* If you lose your passphrase or type it in wrong twice on encryption, your data has gone bye bye +* For real, back up your shit +* Do not trust me or my code + +## Usage +To install: +`sh hidden.sh install` + +To encrypt: +`sh hidden.sh enc` + +To decrypt: +`sh hidden.sh dec` + +## License +Distributed under the [WTFPL Version 2](//www.wtfpl.net/) [![WTFPL](assets/wtfpl-badge.png)](//www.wtfpl.net/) +See [assets/COPYING.txt](COPYING.txt) for text \ No newline at end of file diff --git a/assets/wtfpl-badge.png b/assets/wtfpl-badge.png new file mode 100644 index 0000000..d5bfdd8 Binary files /dev/null and b/assets/wtfpl-badge.png differ diff --git a/hidden.sh b/hidden.sh new file mode 100644 index 0000000..bce9d4c --- /dev/null +++ b/hidden.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# fail on error +set -e + +dir_to_encrypt=./to_encrypt +encrypted_archive_name=./.volume.bin + +encrypted_volume_name=./encrypted_volume.tar.bz2 + +encrypty(){ + echo "Compressing Directory..." + tar cfj $encrypted_volume_name $dir_to_encrypt + # check success of previous or die + echo "Sucesfully Compressed, Shredding Directory..." + srm -rz $dir_to_encrypt + # check success of previous or die + echo "Successfully Shredded Directory, Encrypting. Please Input Passphrase..." + scrypt enc $encrypted_volume_name $encrypted_archive_name + # check success of previous or die + echo "Successfully Encrypted, Shredding Archive..." + srm -rz $encrypted_volume_name + # check success of previous or die + echo "Success: Done" +} + +decrypty(){ + echo "Starting..." + echo "Decrypting. Please Input Passphrase..." + scrypt dec $encrypted_archive_name $encrypted_volume_name + # check success of previous or die + echo "Successfully Decrytped, Shredding Encrypted Archive..." + srm -rz $encrypted_archive_name + # check success of previous or die + echo "Successfully Shredded Encrypted Archive, Decompressing..." + tar xfj $encrypted_volume_name + # check success of previous or die + echo "Successfully Decompressed Decrypted Archive, Shredding Decrypted Archive..." + srm -rz $encrypted_volume_name + # check success of previous or die + echo "Success: Done" +} + +if [ "$1" = "enc" ]; then + encrypty +elif [ "$1" = "dec" ]; then + decrypty +elif [ $1 = "install" ]; then + if ! [ -f "$(command -v scrypt)" ] && [ -f "$(command -v srm)" ] && [ -f "$(command -v tar)" ]; then + echo "Needed Applications Not Found, Installing..." + sudo apt install scrypt secure-delete tar + echo "Success: Installed" + fi + + if ! [ -d $dir_to_encrypt ]; then + echo "$dir_to_encrypt Not Found, Creating..." + mkdir $dir_to_encrypt + fi +else + echo "Usage:\nEncrypt:\n\t./hidden.sh enc\nDecrypt:\n\t./hidden.sh dec\nInstall:\n\t./hidden.sh install" +fi diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..9cd1931 --- /dev/null +++ b/notes.txt @@ -0,0 +1,5 @@ +srm is from the secure-delete package + +srm -rz to_encrypt +srm -rz .volume.bin +srm -rz encrypted_volume.tar.bz2