// Lawrence Bush // Lab Session: 1 // RCS account: bushl // encode.cpp - This is the main file for the encode workspace. // The program accepts three arguments (M,e,N) // (Message, encode key, product of the two // primes). It then uses this information to // encode M. #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: \nencode.exe 47 3 55\n [ M, e, 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"<