The Computer goes to Grade School (and beyond):
Multidigit Arithmetic for Efficient Encryption
CISC 320 Algorithms and Advanced Programming
-- Spring, 2000
Project Goals.
-
To gain experience in the process of selecting/developing a good algorithm
for a given purpose, producing a high performance implementation of
that algorithm, and measuring/demonstrating the performance achieved.
-
Specifically
to produce an implementation of RSA public key encryption/decryption
that is time efficient.
- Programming skills may be categorized as those of design, analysis,
implementation, and testing. This project provides an opportunity
to practice the integrated application of skills in all four areas,
combining the skills of algorithm design and analysis,
which are the primary emphasis in this course,
with the skills of program implementation and testing.
Problem statement.
RSA encryption depends on a significant amount of arithmetic with
non-negative integers. The text is broken into chunks of a size
determined by a parameter k of the encryption system. These chunks are
then treated as k-digit numbers with respect to a base B.
We will
be dealing with numbers of length k B-digits with respect to
the base B = 10000 representation. Thus the numbers will be 4k digit decimal
numbers, and this relation to the familiar representation will ease
debugging. Tools for the conversion from text to numbers and back
will be provided. The project is to develop and test versions of the
arithmetic algorithms with the goal of producing the fastest possible
encryption. Each number will be stored in an array of length 2k,
so there will be no problem of overflowing the array with intermediate
results of multiplication mod n. There is no need to use more than
a few number variables in the program, so there is no issue of wasting
memory here. Furthermore, just pointers to these arrays will be passed
to functions, so there will be not be a cost of copying the arrays
in passing arguments to functions.
Details
-
By Friday, Apr 14, Teams decided.
The project may be done in teams of 1 to 3 people.
Teamwork can be used to share the work of programming and design. There
will also be elements of the project to be done by each person individually.
A group can become a team by notifying me by email by Apr 14. Also
notify me if you want to be a team of one. All others will be assigned
to teams on Friday.
-
By Friday, Apr 21, Version 1: trivial encryption.
The RSA keys contain two numbers, exponent e and modulus n.
For this version, encryption is done by adding e mod n. This allows
us to check out addition and subtraction and use a main() which invokes
the timer mechanism we will be using later.
-
By Friday, Apr 28, Version 2: Straw dog implementation.
For this version, multiplication will be by the classical (school) method,
and the division (reduction to a remainder mod n) also by the classical,
or synthetic method.
-
By Friday, May 5, Version 3: final version.
You present your final version, using details of the arithmetic of your
own design, together with explanation of the methods chosen and timing
results comparing your version with the classical methods.
-
A competition will be conducted of the various submissions and subsequently
we will discuss the the highest performers (and possibly some other
interesting solutions) in class. Performance will be measured on
several values of k, the length of the numbers. Most likely the
values used will be k = 8, 16, and 32 (thus the numbers would be of
of decimal length 32, 64, and 128 base 10 digits).