--- /dev/null
+#!/usr/bin/env bash
+
+die() {
+ echo $@
+ exit 1
+}
+
+[[ $# -eq 1 ]] || die "this script takes exactly one argument: the name of a pdf"
+INPUT=$1
+INPUT_BASE=${INPUT%.pdf}
+[[ -f "${INPUT}" ]] || die "input file ${INPUT} does not exist."
+echo -n Password:
+read -s PASSWORD
+echo
+exec qpdf -password="${PASSWORD}" -decrypt "${INPUT}" "${INPUT_BASE}.decrypted.pdf"