**Team Number: **050

**School Name: **Manzano High School

**Area of Science: **Cryptography

**Project Title: **Tales From the Encrypt

Our group has learned many important skills required for success in the Adventures in Supercomputing Challenge. Ever since the first day of class, our instructor has been teaching us the necessary aspects that are required in the curriculum.

First, we spent six weeks learning the general aspects of html. We learned about hyper links, placing images on a web page, placing colors, and cutting and pasting. Our final project in that rubric was to create our very own web page consisting of pictures, html codes, and placing tables. We edited an existing web page by replacing it with our own files and folders.

Then, we spent two to three weeks setting up both MHS AiS Challenge Linux accounts and accessing our New Mexico AiS Challenge Unix accounts. In our local Linux domain, we learned numerous Unix commands such as, ls, cd, mkdir, rmdir, making files via "pico", and copying/moving files. We also set up both telnet and ftp software at our home computers to allow us to interact with both MHS and the AiS Challenge site.

We spent a week discussing general math algorithms for computing geometric shapes and computing distances and velocities in simple motion problems. Next, we spent five weeks learning the basic concepts of C++ programming code. We learned concepts and programming skills such as setting up the main function, cout and cin commands, mathematical computations, for loops, the use of if-else, mod, and setting up arrays. Also, we used the math algorithms in a Unix machine as the basis of most of our programs. We combined the math algorithms with programming skills towards computing the volume and surface area of a sphere and solving physics problems of motion. We programmed over ten programs that compute different kinds of problems. Basically, our instructor provided us with ample information to write the program code for our project.

The status of my project is uncertain. I have made an encryption program which can take an array of data and encrypt and decrypt it by transposing the elements. Currently the encryption and decryption components are part of the same program, but they function as two separate programs with two different sets of variables. By the end of the semester, I hope to have a program which will encrypt numbers with a key by the same method which is used in the Rijndael algorithm. Eventually I hope to use the bitslicing method to improve the speed of my program and the speed of the Rijndael algorithm. If the Rijndael algorithm cannot be improved, I will instead create a new encryption program and post it for free distribution over the internet.

The source code is available now on /ais/rcordwe/cc_programs/project/neo.cc for the numerical transposition encryption/decryption program. An executable version is called edcrypt. The source code for the text encryption will be available as neo2.cc with a executable as tedcrypt (standing for text encryption/decryption). Hopefully, I will have a version which will encrypt and decrypt both text and numbers or a version which will encrypt only number but will use the current encryption method. Either way, it will probably be called neo3.cc.

My partner, Brian Rosenberg, also has some source code available. His source code will be posted soon along with mine in the folder bsource under CC_programs. His source code is able to encrypt and decrypt as single number using the method of taking it mod another number.

Mathematical Background

The basic function for encryption and decryption is the modulus function. This is remarkably simple to understand, but has many varied possibilities. In order to find a number mod another number, say 10 mod 3, one just divides 10 by 3 and takes the remainder. This function allows encryption in that it has a number of valuable properties. First of all, if one takes a prime number, say 7, and takes any other number less than 7, say 4, and takes 4 mod 7, 4*2 mod 7, 4*3 mod 7 all of the way up to 7 then all of the resulting numbers will be the numbers 0 through 6. Also notice that the order they appear in is changed. In the given example, the numbers appear in the order: 4, 1, 5, 2, 6, 3, 0. This is valuable because it allows encryption of a series of data elements.

For example, suppose that I have the array of number 8, 5, 4, 6, 7, 9, 11, 2345. To encrypt: I add three 0 or junk elements at the end to make the number of elements prime. My new array is 8, 5, 4, 6, 7, 9, 11, 2345, 0, 0, 0. I then decide arbitrarily that my key is going to be 7. In my program, I chose to use a system which takes each number's position (for example, 4 has position 3) and multiplies that position by the key (7), takes that modulus the number of elements, and that is the place that that number goes into (in this case the second to last.)

The advantages of this system are multifold. This system works well because any key can be used that is a whole number smaller than the number of elements and relatively prime to it. If the number of elements is prime, there is no problem with this. This method is relatively easy to program, and does not need to use a significant amount of temporary memory. Also, this method is fairly useful for encrypting anything with bits in it.

However, there are a few disadvantages. Notice that for only a few elements, the encryption program does not work as well, leading to a need to encrypt large enough arrays of data to ensure that there will be no problem with doing a brute force attack. Notice that encrypting large numbers of bits may also be difficult and time consuming, due to the fact that the reader and writer would need to move from position to position to find the bits which go to their proper position. However, this method, while not the actual one used to encrypt data, is certainly useful.

**Team Members**

**Sponsoring Teacher(s)**

**Project Mentor(s)**

- William Cordwell