Skip to content

Commit

Permalink
added support for asymmetric encryption for pbputs; updated documenta…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
dustinkirkland committed Jul 1, 2011
1 parent 649b7ba commit 70c8c37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions pbput
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,23 @@ case "$PROG" in
if [ -r "$1" ]; then
# Read file from argument
tar cf "$TEMP" "$1"
# Second argument indicates a target user in the gpg keyring
[ -z "$2" ] && GPG_OPTS="-c" || GPG_OPTS="-s -e -r $2"
else
# Read from standard in
cat /dev/stdin > "$TEMP"
# Argument indicates a target user in the gpg keyring
[ -z "$1" ] && GPG_OPTS="-c" || GPG_OPTS="-s -e -r $1"
fi
if [ "$PROG" = "pbputs" ]; then
mv -f "$TEMP" "$TEMP".in
cat "$TEMP".in | gpg -c > "$TEMP"
cat "$TEMP".in | gpg $GPG_OPTS > "$TEMP"
rm -f "$TEMP".in
fi
lzma -9 -f -c "$TEMP" | base64 | pastebinit -b "$URL"
;;
*)
echo "ERROR"
echo "ERROR" 1>&2
exit 1
;;
esac
6 changes: 3 additions & 3 deletions pbput.1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ pbget - decode and decompress arbitrary files from pastebin.com

cat foo | \fBpbput\fP

\fBpbputs\fP [FILENAME]
\fBpbputs\fP [FILENAME] [GPG_USER]

cat foo | \fBpbputs\fP
cat foo | \fBpbputs [GPG_USER]\fP

\fBpbget\fP URL [DIRECTORY]

Expand All @@ -22,7 +22,7 @@ cat foo | \fBpbputs\fP

\fBpbget\fP is a program that be used to retrieve content uploaded to a pastebin by \fBpbput\fP.

\fBpbputs\fP operates exactly like \fBpbput\fP, except the user is prompted for a symmetric passphrase for encrypting the content with \fBgpg\fP(1) before uploading. \fBpbget\fP will automatically prompt the receiving user for the pre-shared passphrase.
\fBpbputs\fP operates exactly like \fBpbput\fP, except it encrypts the data. An optional GPG_USER argument is allowed, which will sign and encrypt the data to the target user in one's keyring (which could be oneself!). Otherwise, the user is prompted for a symmetric passphrase for encrypting the content with \fBgpg\fP(1) before uploading. \fBpbget\fP will automatically prompt the receiving user for the pre-shared passphrase.

\fBpbput\fP and \fBpbputs\fP can take its input either on STDIN, or as a FILENAME argument.
- If STDIN is used, then the receiving user's \fBpbget\fP will simply paste the input on STDOUT.
Expand Down

0 comments on commit 70c8c37

Please sign in to comment.