Skip to content

Instantly share code, notes, and snippets.

@yellowcrescent
Last active April 22, 2019 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yellowcrescent/afb08d74746210cc0370921aafec2629 to your computer and use it in GitHub Desktop.
Save yellowcrescent/afb08d74746210cc0370921aafec2629 to your computer and use it in GitHub Desktop.
decrypt and open aesgcm URLs
#!/bin/bash
INAES="$1"
URL=$(echo $1 | sed 's/aesgcm:/https:/')
KEY=$(echo $1 | awk -F\# '{print $2}')
EXT=$(echo $1 | awk -F\# '{print $1}' | awk -F. '{print $NF}')
TMPFILE=$(tempfile).${EXT}
echo "Decrypting to $TMPFILE ..."
curl -s "${URL}" | ./aesgcm ${KEY} > ${TMPFILE}
xdg-open ${TMPFILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment