mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-28 18:28:35 -05:00
17 lines
504 B
Plaintext
17 lines
504 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
# POSIX shell client for PurritoBin to decrypt the message
|
||
|
|
||
|
: "${P_SERVER=https://bsd.ac}"
|
||
|
: "${P_PORT=42069}"
|
||
|
: "${P_MAXTIME=30}"
|
||
|
|
||
|
url="$1"
|
||
|
baseurl="${url%\/*}"
|
||
|
vals="${url##*\#}"
|
||
|
paste=$(printf %s\\n "${vals}" | cut -d'_' -f1)
|
||
|
key=$(printf %s\\n "${vals}" | cut -d'_' -f2)
|
||
|
iv=$(printf %s\\n "${vals}" | cut -d'_' -f3)
|
||
|
curl --max-time "${P_MAXTIME}" --write-out "\n" --silent "${baseurl}/${paste}" | openssl enc -aes-256-cbc -base64 -d -K ${key} -iv ${iv}
|
||
|
unset url baseurl vals paste key iv
|