Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Israel Torres
- # 20160920
- #
- STRING='Here I am, and there you are.'
- function chr () { # in 65, out A
- [ "$1" -lt 256 ] || return 1
- printf "\\$(printf '%03o' "$1")"
- }
- function ord () { # in A, out 65
- LC_CTYPE=C printf '%d' "'$1"
- }
- for (( c=0; c<=${#STRING}; c++ )); do
- #echo -en "${STRING:$c:1}"
- ORDVAR=$(ord "${STRING:$c:1}")
- XORVAR=$(( ORDVAR ^ 20 ))
- #echo -en "$XORVAR"
- CHRVAR=$(chr $XORVAR)
- echo -en "$CHRVAR"
- done
- #EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement