#!/bin/sh # GPG Encrypted Letters - Oldschool meets Newschool # GPG encrypt your message and put it into a QRCode # This QRCode will be sent to your printer # Now send this letter to it's destination # To decrypt you have to scan the letter # And this script will decrypt it for you. # # Presented by myself at the #1 Cryptoparty in Luxembourg # # Coded by Perforin/virii - cypherpunk.lu - c3l.lu receiver=$2 if [ "$1" = "-e" ]; then # encrypting message echo "[+] Type your message" echo "[!] Press CTRL+D when done" gpg -e -a -r $receiver -o qr-message.tmp cat qr-message.tmp | qrencode -o encrypted-QRcode.png rm qr-message.tmp echo "[+] Sending to printer..." lp -n 1 encrypted-QRcode.png rm encrypted-QRcode.png echo "[+] Done!" echo "[!] You can now send this QRcode to your friend" elif [ "$1" = "-d" ]; then # decrypting message # you need zbarimg version 0.10! Currently NOT in the repos # Build from source http://zbar.sourceforge.net/download.html echo "[+] Scanning..." scanimage -p --format=tiff --resolution=200 > scanned_QRcode.tiff echo "[+] Decoding..." echo "[+] Press CTRL+D if cleartext is not shown" zbarimg --raw scanned_QRcode.tiff | gpg -d rm scanned_QRcode.tiff else echo "GPG QRcode Maker/Reader" echo "by virii - C3L.lu\n" echo "Usage: $0 [options] [receiver]" echo "Encryption: $0 -e " echo "Decryption: $0 -d\n" fi