CX 103: Introduction to Computers

Spring 2001

Assignment 24

Due: Wednesday, April 16

Reading

Begin reading Chapter 9 "Fire and Ashes" in Freiberger and Swaine, Fire in the Valley: The Making of the Personal Computer.

Writing




Read carefully our solution, Encryption.html, to the programming exercise of Assignment 23. It may not be the simplest possible way to program the stated encryption scheme, but it was designed so that it is relatively easy to convert the program to one which implements more involved encryption ideas.

Suppose, for example, that instead of taking characters two at a time, we used trios of three successive characters. Each triple would then be initially replaced by a six digit number. We would then add some fixed number K % 10 to each digit (we used K = 7 before) and finally we swap the inner and outer digits of the result. The output of the program would then a sequence of six digits numbers.

Write a paragraph discussing what specific pieces of the program would have to be changed and how you would change them. Some changes may be as easy to do as replacing a "2" by a "3" but other modifications may require a bit more. (Note for example, you may have to add one or two X's to the input to make its length a multiple of 3; what's a simple way to do this in JavaScript?).

Bear in mind that we may eventually want to encrypt by taking blocks of 4 consecutive characters or 5 consecutive ones, etc. Let this ultimate goal guide you in your formulations.

For your convenience in writing up your remarks, there is a file (Encrypt_With_Numbered_Lines) with our JavaScript program that has each line numbered, as Deitel, Deitel & Nieto do.