Skip to content

Instantly share code, notes, and snippets.

View nquangit's full-sized avatar
🥰
Uhm ❤️ R

Huỳnh Ngọc Quang nquangit

🥰
Uhm ❤️ R
View GitHub Profile
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active July 19, 2024 21:01
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead