1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Generating Cryptograms With Ruby

By

1 of 5

Creating Cryptograms

This Ruby script will generate a cryptogram out of any text file. A cryptogram is a word or phrase in which each letter is replaced with a different letter from the alphabet. For example, all of the E's can be replaced with J's, and the T's with M's. The objective is to find out which letters map to each other and decrypt the original message.

Generating a cryptogram is easy, but this script takes a few shortcuts to make it less verbose. In particular, the zip and flatten array methods are used to help generate a lookup table for the cryptogram.

  1. About.com
  2. Technology
  3. Ruby
  4. Tutorials
  5. Ruby Scripts--Cryptograms

©2014 About.com. All rights reserved.