// Lawrence Bush // Lab Session: 1 // RCS account: bushl // decode.cpp - This is the main file for the decode workspace. // The program accepts three arguments (R,d,N) // (Encoded Message, decode key, product of the // two primes). It then uses this information to // decode N. #include #include using std::endl; #include "modexp.h" int main(long int argc, char * argv[]) { // This function tests the size of argc to make sure two parameters were // passed to the function. // Note that the computer considers the program name as one argument, // therefore, we test to see if there are 3 arguments. if(argc != 4) { // arg needs to be 4 for this std::cerr << "Invalid command line parameters.\n" << "\nUsage: \ndecode.exe 38 27 55\n [ R, d, N ]\n" <<"\n\nIf you are running this in VC++, do the following:\n Alt+F7\n Click on Debug Tab (next to general)" <<"\n Type parameters " <<"into Program Arguments text box.\n"<