Last active
December 13, 2019 02:15
-
-
Save xkef/49ac82efa737a82aff5affb16f999e5e to your computer and use it in GitHub Desktop.
upload utility script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 1. 'tar' saves many files together into a single tape or | |
# disk archive. | |
# | |
# 2. 'xz' is a general-purpose data compression tool, | |
# we use high compression rate and verbose output. | |
# | |
# 3. 'openssl is a cryptography toolkit, we use strong, symmetric | |
# aes256 encryption. | |
# | |
# 4. upload to file.io using curl, expiry 24h / 1 download | |
# output destination | |
OUTPUT_FILE=pias_data_encrypted.xz | |
echo '-> |1/2| compress (xz) and encrypt (aes256)' | |
echo ' ! every file in current directory !' | |
# compression: xz for better compression ratio | |
# encryption: openssl with aes256 (basically uncrackable using good password) | |
tar cf - * | | |
xz -9 -c -v - | | |
openssl enc -e -aes256 \ | |
-out $OUTPUT_FILE | |
printf "\n-> |2/2| uploading\n" | |
curl -F "file=@$OUTPUT_FILE" https://file.io/?expires=1d | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment