PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ROT13 In Bash On Linux Code Cipher Example

Go down

ROT13 In Bash On Linux Code Cipher Example Empty ROT13 In Bash On Linux Code Cipher Example

Post by jamied_uk 1st August 2016, 21:21



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
jamied_uk
jamied_uk
Admin

Posts : 3027
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

ROT13 In Bash On Linux Code Cipher Example Empty Re: ROT13 In Bash On Linux Code Cipher Example

Post by jamied_uk 30th April 2017, 22:30

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!
jamied_uk
jamied_uk
Admin

Posts : 3027
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum