Thursday, March 15, 2012

[Ruby] Rail Fence Cipher

          Hello, Reader ^^! Back again with source code. This time is a  Rail Fence Cipher which is made from Ruby programming language. This one is a bit difficult and tricky. The formula needed is also tricky. The coding of encryption is easier than the decryption. Now for a bit of demonstration:


Take a string "Hello World!"
Remove all non-number and non-alphabet. Uppercase all of the string. Remove all the space. The result:
"HELLOWORLD"


Now, let's arrange them like this:


H   O   L
 E L W R D
  L   O


Now, based on its arranged form, from left to right and below, it is turned into HOLELWRDLO as the encryption result. That's how the Rail Fence Cipher do.


Okay, that's all I can say. Thank you for reading ^^!


Download/View Source Code
- Dropbox
- Dropbox (Repository)
- GitHub
GitHub (Repository)





4 comments: