ROT13 In Bash On Linux Code Cipher Example
Page 1 of 1
ROT13 In Bash On Linux Code Cipher Example
- Code:
sudo gedit .bashrc
- Code:
function rot13 {
if [ -r $1 ]; then cat $1 | tr '[N-ZA-Mn-za-m5-90-4]' '[A-Za-z0-9]'; else echo $* | tr '[N-ZA-Mn-za-m5-90-4]' '[A-Za-z0-9]';
fi
}
# alias rot13="tr a-zA-Z n-za-mN-ZA-M"
Example.sh
- Code:
#!/bin/bash
# Usage: ./example.sh "uryyb gurer"
echo "$@" | rot13
- Code:
./example.sh "uryyb gurer"
Last edited by jamied_uk on 12th April 2018, 15:17; edited 1 time in total
Re: ROT13 In Bash On Linux Code Cipher Example
Decryption is easy since 13 is the half way point of the 26 chars in the alphabet, so running this cypher will reveal the plaintext or Decrypted text!
Similar topics
» Using Sed bash Script On Linux To Generate Morse Code Without Sound
» Bash Psychic Game For Linux Bash
» Numerology With Bash Code Example
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» A simple bash fruit machine game code example
» Bash Psychic Game For Linux Bash
» Numerology With Bash Code Example
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» A simple bash fruit machine game code example
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum