README.mdfile in the starter code repository
There you are. Minding your own business. Just standing outside and waiting for the Eclipse of the Century.
In the distance, you hear the hum of a helicopter. Although it doesn’t quite sound like a helicopter. And it’s getting louder. You see a great shadow crawl across the Tri-State Area.
But it’s not the moon.1
Suddenly, a cartoonish, Mickey-Mouse-gloved claw reaches from the dark entity above. It scoops you up in one quick motion and yanks you off the ground.
“I saw your resume at the career fair” a voice says. “You didn’t give it to me, but I definitely saw it.”
The voice emerges from the shadows. A… man?2… approaches you with a look of pride.
“I’m just so happy you’ve decided to work for me…”
He pushes a button on a single-red-button remote. Nothing happens.
He looks at the button with disdain and presses it harder, faster. He hits the bottom of the remote. A cheesy thunder and lightning sound effect plays.
“DOCTOR HEINZ DOOFENSHMIRTZ” he yells.
Timidly, he explains. “That’s my name. I’m Heinz Doofenshmirtz… It would have been better if the sound… well you get it.” He puts the remote down. “Welcome to Doofenshmirtz Evil Incorporated!” He pulls a cord and a Welcome banner unfurls, slowly dropping balloons and confetti.
“Alright, now that’s enough fun. We’re on a deadline!” he shouts and hurries over to a laptop. He returns and explains, “I need you to finish this decrypt-inator program, so that I can figure out when Perry the Platypus is going to arrive to foil my evil plan!”
You raise an eyebrow.
“You see, OWCA3 electronically transmits orders to their agents, which I can intercept with my intercept-inator! However, I can’t actually tell what they say because they’re encrypted. That’s why I need you to fix my decryptinator!”
You raise the other eyebrow. Both eyebrows are raised.
Using his Intercept-inator, Dr. Doofenshmirtz is able to intercept transmissions sent from OWCA to its agents. Your job is to test and repair the C++ class that is responsible for decrypting those transmissions.
Each agent has a unique 3-digit ID that they use in to decrypt the messages meant for them. Each digit (1 through 5) corresponds to a numbered disk that performs a cryptographic operation.
So what are the disks for?
The OWCA decryptor contains 3 slots called rotors (labeled
Each rotor can accept one of 5 different disks (numbered 1 through 5).
When a message is entered into the decryptor, it passes each character through each of the three rotors from
Each rotor uses its assigned disk to partially decrypt the each letter, so that the output of the
right rotor (the last rotor) is the original (plaintext) message.
You can find a description of the original decryption scheme here: https://sites.google.com/a/mst.edu/price/courses/cs-1570/hw/2015/fall/assignment-06.4
For the sake of security, OWCA modified the behavior of some of the disks. Below is a summary of how the OWCA decryption disks work.
f(ch) = (((ascii value of ch) + 3) % 26) + 65
f(ch) = (((ascii value of ch) + 5) % 26) + 65
A -> Y
B -> J
C -> T
D -> Z
E -> O
F -> G
G -> C
H -> L
I -> M
J -> A
K -> E
L -> K
M -> U
N -> H
O -> P
P -> X
Q -> S
R -> F
S -> W
T -> B
U -> D
V -> Q
W -> N
X -> V
Y -> R
Z -> I
We happen to have some example data that demonstrates how a rotors work when equipped with different disks.
The table below shows how a single rotor (configured to use a specific disk) should decrypt a string.
For example, if you have a rotor configured to use disk 1 and you feed it the characters (in order)
KBLCMDNEOFPGQHRISJTKULVMWN, you should get the
ABCDEFGHIJKLMNOPQRSTUVWXYZ as output.
|Disk Number||Input String||Output String|
Additionally, we happen to have two example messages (encrypted) that decrypt to a known string.
Each of these messages decrypt to
THE_QUICK_BROWN_FOX_JUMPS_OVER_THE_LAZY_DOG for obvious reasons.
|Disk Order||Input String|
|1 2 3||
|1 2 4||
|1 2 5||
So how does each agent know their own disk order?
An agent’s ID corresponds to their disk order.
For example, Perry the Platypus’ agent ID is
315, so his disk order will be
3 1 5.
Peter the Panda has ID
231, Pinky the Chihuahua has ID
341, and so on in that order.
Fortunately, we aren’t concerned with this aspect of agent communication.
You’ve been given a partially complete project. You are to do the following (in order):
Refer to this assignment’s rubric for further description of point values for completed tasks.
Boost’s unit test framework does not live in a place where
g++ ordinarily looks for libraries.
That means that we have to tell
g++ about it.
The compile command you will use is…
g++ *.cpp -lboost_unit_test_framework
g++ that we’re going to need to link against the unit test framework.
You can also use
make to build the program.
The starter code comes with a simple
Makefile that should do the trick.
There’s a script in the project called
show-coverage that will compile everything, run the unit tests, and show the code coverage of the test suite.
Make sure that your tests achieve 100% coverage for
show-coverage will also create two files:
You can read those to see how many times each statement in the program was run.
If a line was never run, it will be marked with a bunch of pound signs (
#######) to get your attention.
coutto help debug your code. Be sure to remove those statements before you submit.
charas a parameter and returns a
char. You can’t just pass a
stringto it… Maybe you could use a loop and the bracket (
) operator to go
REQUIRElevel assertions if you feel that they’re necessary. If you decide to, be sure to include a comment explaining why
*.coveragefiles or compiled files. Your assignments will be compiled and run as part of the grading process.
g++on campus Linux machines (
rc__xcs213.managed.mst.edu). If you choose to develop on another platform, make sure that it works on the campus Linux machines before you submit.
This assignment is worth 50 points. It will be graded according to the following rubric:
|Feature||Points Possible||Mostly or completely incorrect (0% of points possible)||Needs improvement (50% of points possible)||Adequate, but still some deficiencies (75% of points possible)||Mostly or completely correct (100% of points possible)|
|Correctly tested functionality of disk 1||3||0 / 3||1 / 3||–||3 / 3|
|Correctly tested functionality of disk 2||3||0 / 3||1 / 3||–||3 / 3|
|Correctly tested functionality of disk 3||3||0 / 3||1 / 3||–||3 / 3|
|Correctly tested functionality of disk 4||3||0 / 3||1 / 3||–||3 / 3|
|Correctly tested functionality of disk 5||3||0 / 3||1 / 3||–||3 / 3|
|Correctly tested decryption of messages||5||0 / 5||2 / 5||–||5 / 5|
|Successfully repaired decryption and passed all correctly implemented unit tests||5||0 / 5||2 / 5||3 / 5||5 / 5|
|Submitted code properly with Git and GitLab (
||10||0 / 10||5 / 10||7 / 10||10 / 10|
|Program compiles and links without errors or warnings||5||0 / 5||–||–||5 / 5|
|Achieved 100% coverage for funcs.cpp and rotor.cpp||5||0 / 5||2 / 5||3 / 5||5 / 5|
|Code review (proper style, sufficient comments, etc.)||5||0 / 5||2 / 5||3 / 5||5 / 5|
Each cell indicates how many points out of the available points will be awarded for that feature (row) and assessment level (column).
-- cannot be achieved.
For example, no partial credit will be awarded for code that has compiler errors or warnings.
Points for that feature are all-or-nothing.
11:59:59 PM CDT – Tuesday, August 29, 2017
Refer to the assignment submission page on the course website for details on submitting your code to GitLab.
When grading your assignment, the following series of commands will be used to compile your code
# Assuming that we're at the top directory of your project $ make $ ./test_decrypt $ ./show-coverage
Your code must compile with this command on the campus Linux machines.
show-coverage script will be run to check code coverage.
Do not modify
Or so you think. You done burnt up your retinas looking at the sun. ↩
Possibly a bird. Again with the looking-at-the-sun business. ↩
The Organization without a Cool Acronym employs agents to foil the plots of evil scientists around the world. ↩
The author of that specification is a fellow mad scientist and former colleague of Dr. Doofenshmirtz. They had a falling out. Legend has it that it all started with a heated argument about cows. ↩