rot13 was intended as an example of what you should never do.
Here is a version of rot13 written in perl. Perl is rather obfuscated by default.
Code: Select all
# echo 'The quick brown fox' | perl -pe 'tr/A-Za-z/N-ZA-Mn-za-m/'
Gur dhvpx oebja sbk
# echo 'Gur dhvpx oebja sbk' | perl -pe 'tr/A-Za-z/N-ZA-Mn-za-m/'
The quick brown fox
#
This would encrypt/decrypt the text in a file, results printed on the terminal:
Code: Select all
cat file.in | perl -pe 'tr/A-Za-z/N-ZA-Mn-za-m/'
This would encrypt/decrypt a file, results printed to a file:
Code: Select all
cat file.in | perl -pe 'tr/A-Za-z/N-ZA-Mn-za-m/' > file.out
One way to obfuscate a script is to put it in a compiled executable. You can search the internet for "obfuscate shell script"