CX 103: Introduction to Computers

Spring 2001

Assignment 26

Due: Monday, April 23

Reading

Finish reading Chapter 23: "Electronic Commerce and Security" and reading Sections 1 -4 of Chapter 13: "JavaScript/JScript: Objects" (which contain a summary of the string processing capabilities of JavaScript) in Deitel, Deitel & Nieto, Internet & World Wide Web: How to Program.

Begin reading Chapter 10 "Wealth and War" in Freiberger and Swaine, Fire in the Valley: The Making of the Personal Computer.


Programming Exercise

Hand in on Monday

Modify our program Encryption.html to use trios of three successive characters. Each triple is initially replaced by a six digit number. We then add some fixed number S % 10 to each digit (we used S = 7 before) and finally we reverse the order of the digits of the new 6 digit number.

Allow the user to specify the value of S when the program is run. Handle input and output through forms.

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.

Extra Credit

Create an enhanced version of Encryption.html which provides the following additional features (as demonstrated in class)

(1) The user may specify the size B of the block of characters to be encrypted using a pull-down menu offering options of block sizes 1 - 8. The output will be an array of integers with 2B digits.

(2) The user may specific that the output be displayed as 2B-digit integers separated by spaces or that it be displayed as a single long sequence of digits.