Last active
August 29, 2015 14:13
-
-
Save adrelanos/defdf9d693c2726514fd to your computer and use it in GitHub Desktop.
clearsign failed intuition demo
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/bash | |
set -x | |
set -e | |
true "Clean up eventual previous run." | |
rm -f clearsign_decrypt_demo_test_file.txt.asc | |
rm -f clearsign_decrypt_demo_test_file.txt | |
true "Creating test file..." | |
echo "test" > clearsign_decrypt_demo_test_file.txt | |
true "Let's clearsign it." | |
gpg --clearsign clearsign_decrypt_demo_test_file.txt | |
true "--verify will work as expected." | |
gpg --verify clearsign_decrypt_demo_test_file.txt.asc | |
true "So does --decrypt." | |
gpg --decrypt clearsign_decrypt_demo_test_file.txt.asc | |
true "Let's append some extraneous, potentially malicious text." | |
echo "Extraneous appended content here." >> clearsign_decrypt_demo_test_file.txt.asc | |
true "Let's prepend some extraneous, potentially malicious text." | |
sed -i.old '1s;^;Extraneous prepended content here.\n;' clearsign_decrypt_demo_test_file.txt.asc | |
true "--verify will still work, even if you expect it should fail!" | |
gpg --verify clearsign_decrypt_demo_test_file.txt.asc | |
true "However, --decrypt will at least only show the clear signed text." | |
gpg --decrypt clearsign_decrypt_demo_test_file.txt.asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output.