NEWSGROUP Cipher
NEWSGROUP Cipher
I google the answer,but i don't know why the answer is that.For my english is poor,can anybody expain how the cipher works or give me a clue? thanksl
3Qmichuber wrote:http://en.wikipedia.org/wiki/ROT13
-
- Posts: 22
- Joined: Wed Apr 13, 2011 12:00 am
- Location: Vila Velha
- Contact:
-
- Posts: 3
- Joined: Fri Jul 08, 2011 11:57 am
- Location: Philippines
- Contact:
I admit that it is really hard.
i google it and understanding the code. 26/2 = 13; then substitution method..
example. A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
example. A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
I want to learn more.
My solution in ruby by doing some math with the ASCII table:
Code: Select all
input = "Guvf zrffntr vf rapelcgrq va ebg 13. Lbhe nafjre vf svfupnxr."
input.each_byte { |x|
# lower case letters
if (65..90) === x
print (65 + (x - 52) % 26).chr
# capital letters
elsif (97..122) === x
print (97 + (x - 84) % 26).chr
# everything else
else
print x.chr
end
}