O'Reilly logo

Ruby For Kids For Dummies by Christopher Haupt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Project 8

Code Breaker

Welcome to the world of encryption, ciphers, and secret messages! Have you ever wanted to send someone a hidden message that only you and the person you’re sending it to could understand? Maybe you came up with a secret code on your own and used it to manually translate a letter or note — but that can be a lot of work. Converting messages into a form that hides their meaning is called encryption, and converting the message back to something that is easy to understand is called decryption. Why not let a computer do that work for you?

In this project, you write a Ruby program that will do the labor-intensive work of encrypting and decrypting your notes. You’ll be able to write your note in your editor and save it as a file. Then you’ll be able to use the project’s program to convert the note into a hard-to-read, encrypted form. The same program will be able to take an encrypted file and change it back to something you can read.

image

Organizing a New Project

In this project, you use Atom to create and edit your program and to create test files with secret messages. You store this project’s source code in a single Ruby file. The secret messages are stored in other files. You use the terminal program to run, test, and play around with the project code.

remember If you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required