// Lawrence Bush // Lab Session: 1 // RCS account: bushl // createkey.cpp - This is the main file for the create key // workspace. The program accepts two prime // numbers and computes a key (e), a decode key (d) // and the product (N) of the inputs. #include #include using std::endl; #include "gcd.h" #include "mmi.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 != 3) { // arg needs to be 3 for this std::cerr << "Invalid command line parameters.\n" << "\nUsage: \ncreatekey.exe 5 11\n [ p, q ]\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"<