Skip to content

Instantly share code, notes, and snippets.

@pvdb
Last active February 24, 2024 09:55
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 pvdb/34a57da12cfce63261ca1d727cf6303d to your computer and use it in GitHub Desktop.
Save pvdb/34a57da12cfce63261ca1d727cf6303d to your computer and use it in GitHub Desktop.
Obfuscate sensitive input read from STDIN and write to STDOUT
#!/usr/bin/env sh
#
# INSTALLATION
#
# ln -s ${PWD}/obfuscate $(brew --prefix)/bin/
# sudo ln -s ${PWD}/obfuscate /usr/local/bin/
#
# ALIAS
#
# ln -s ${PWD}/obfuscate $(brew --prefix)/bin/pbobfuscate
# sudo ln -s ${PWD}/obfuscate /usr/local/bin/pbobfuscate
#
if [ "${0##*/}" = "pbobfuscate" ]; then
if [ "$(uname)" = "Darwin" ]; then
pbpaste | obfuscate | pbcopy ;
exit 0 ;
fi
fi
tr '[:digit:]' '0' | tr '[:lower:]' 'x' | tr '[:upper:]' 'X' | tr '[:punct:]' '.' ;
# That's all Folks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment