Important Announcements
Assignments
Course Documents
Course Description
Useful Links
gcd.cc
in the class directory
/home/CS/cs469/001/INST.
A recursive algorithm for computing GCDs is given as follows, as a function in C++:
void gcd(int a, int b, int& d)
{
if (a == 0) {
d = b;
} else if (a <= b) {
gcd(a, b-a, d);
} else {
gcd(b, a, d);
}
}
This function returns the value of the GCD
in the reference parameter d.
The C++ code for this gcd function,
together with a driver program,
can be found in the following file:
/home/CS/cs469/001/INST/gcd.cc
You are to modify the gcd procedure
by adding two additional reference parameters
x and y,
so that the procedure parameters are given as follows:
void gcd(int a, int b, int& d, int& x, int& y)
You should also modify the body of the procedure so that,
when the function returns,
the reference parameters x and y
will contain integer values such that
d = a*x + b*y
Finally, you should modify the main driver program
so that it defines the variables x and y,
uses these variables in the call
to your modified gcd function,
and reports on the values of x and y
as well as the value of d.
Hint: Here is how to treat the first case:
if (a == 0) {
x = 0;
y = 1;
d = b;
} else ...
Your solution should be in a file named (appropriately)
gcd.cc,
in your class directory
/home/CS/cs469/001/<your-login-goes-here>
The directory /home/CS/cs469/001/INST/Caesar
contains four text files,
each of which is a ciphertext of a plaintext
using the Roman alphabet
(all in uppercase letters,
with non-letters unchanged from the original)
produced using a Caesar Cipher
with a key in the range 1 to 25.
Each of the ciphertexts uses a different key.
You are to write a program that will determine the key used to encrypt each of these ciphertexts, automatically and without human intervention (if possible). Your program may be in any programming language you wish, so long as it is supported on the CS systems.
The ciphertexts may not all be in English, so your program may not work well if it depends solely on dictionary word lookups, for example.
Put your program in a directory named Caesar
in your class directory
/home/CS/cs469/001/<your-login-goes-here>.
Also, create a file README in this directory
that is a summary of how to use the program
and conclusions about the keys used
to encrypt each of the plaintexts.
See the file /home/CS/cs469/001/INST/Caesar/README
for details on how to report your results.
The course syllabus will be available on-line shortly.
Introduction to Computer Security. 3 cr. U/G.
Privacy and authenticity of data and programs,
communication, operating systems, network and database security,
computer viruses, cryptography, private and public key cryptosystems,
protocols.
Prereq: jr st; C or better in both CompSci 217(P) & 201(P)