purrito(1)                                           purr(1)
                             /\_/\
                            ( o.o )
                             > ^ <


NAME

	purrito: ultra fast, minimalistic, encrypted command line paste-bin
	purr: POSIX shell client to paste to bsd.ac
	meow: POSIX shell client to paste encrypted paste to bsd.ac
	meowd: POSIX shell client to decrypt encrypted paste from bsd.ac


CLIENT

	purr() {
		url="$(curl --silent --data-binary "@${1:-/dev/stdin}" bsd.ac:42069)"
		printf '%s\n' "${url}"
	}


	# POSIX shell client to upload encrypted message
	meow() {
		# we need to generate a 256 byte random key
		# for using the aes-256-cbc cipher
		key="$(openssl rand -hex 32)"
		iv="$(openssl rand -hex 12)"
		# calculate its encryption and upload it
		url="$(openssl enc -aes-256-cbc -K ${key} -iv ${iv} -e -base64 -A < ${1:-/dev/stdin} | purr)"
		printf '%s\n' "${url%\/*}/paste.html#${url##*\/}_${key}_${iv}"
	}


	# POSIX shell client to decrypt the message
	meowd() {
		url="$1"
		baseurl="${url%\/*}"
		vals="${url##*\#}"
		IFS="_" set -- $vals
		encrypteddata="$(curl --silent ${baseurl}/$1)"
		decrypteddata="$(printf '%s\n' $encrypteddata | openssl enc -aes-256-cbc -base64 -d -K $2 -iv $3)"
		printf '%s\n' "${decrypteddata}"
	}


USAGE

	~$ purr c00lfile.txt
	https://bsd.ac/purrit0

	~$ purr < h0tfile.txt 
	https://bsd.ac/purri1o

	~$ echo Hello world. | purr
	https://bsd.ac/d4nklit

	~$ purr
	This is my input
	it can span multiple lines
	<Ctrl-d to exit>
	https://bsd.ac/curlpr0


LIMITS

	max paste size: 64KB

	limit of one paste every 3 seconds, abusing ip is 
	banned for 10 minutes


SOURCE

	https://github.com/PurritoBin/PurritoBin