亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 187-211.html

?? 這個是密碼學的經典著作
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
   //check to see if the user wants the line to appear in plain text
   if(ip[0] == '/'){

     if (strlen(BUFFER)>0){

         //empty whatever is in the buffer
         groupBUFFER(output, strlen(BUFFER));
     //adjust the buffer
        strcpy(BUFFER, (BUFFER+strlen(BUFFER)));
     //output plaintext
     }

   output << ip << endl;

   }
   else {
     //encipher the line
     char *msg = formCipheredMessage(CTEXT, ip, encoded_msg);
     //print the cipher in groups of five to the ouput file
     printCipherToFile(output, msg);
    }
   }

   //empty the rest of the buffer
   groupBUFFER(output, strlen(BUFFER));

   //notify user where plaintext and ciphertext files are
   cout << "Plaintext file is: " << inp_file << endl;
   cout << "Encrypted file is: " << outp_file << endl << endl;
 }

 //don't forget to close the files
 input.close();
 output.close();

 //return success of the operation
 return success;
}//end encryptText()


//----------------------------------------------------------------
//Function: deleteMatrix()
//Parameters: matrix - the matrix we are going to destroy
//      R - the number of rows in the matrix
//      C - the number of columns in the matrix
//Return Type: None
//Purpose: Destroys the dynamically allocated matrix!
//----------------------------------------------------------------
void deleteMatrix(char **&matrix, const int R, const int C)
{
 for(int ix=0; ix<R; ix++)
   delete [] *(matrix+ix);

 delete [] matrix;

 return;
}//end deleteMatrix()


//----------------------------------------------------------------
//Function: display()
//Parameters: name - the name of the file the user wants displayed
//Return Type: None
//Purpose: Echoes the resulting output file to the screen.
//----------------------------------------------------------------
void display(char *name)
{
 ifstream infile(name, ios::in);
 char input[SIZE];

 if(!(infile)){
   cerr << "Unable to open input file for display." << endl;
 }
 else {
   while (infile.getline(input, SIZE, '\n')){
    cout << input << endl;
   }
 }

 return;
}//end display()


//----------------------------------------------------------------
//Function: findLowestValue()
//Parameters: values - the ASCII values of all characters in the
//            top row of the matrix
//      COLS - the number of columns in the matrix
//Return Type: int - the column we want.
//Purpose: Determines what column we are going to extract from
//the matrix and put into the cipher stream.
//----------------------------------------------------------------
int findLowestValue(int *&values, const int COLS)
{
 int loc=0, lowest = DUMMY_VAL;

 for(int ix = 0; ix < COLS; ix++){
   if(*(values+ix) != DUMMY_VAL){
     if(*(values+ix) < lowest){
       lowest = *(values+ix);
       loc = ix;
     }
   }
 }

 *(values+loc) = DUMMY_VAL;

 return loc;
}//end findLowestValue()


//----------------------------------------------------------------
//Function: formatData()
//Parameters: data - the array we want to format
//Return Type: None
//Purpose: Get rid of all spaces in the array.
//----------------------------------------------------------------
void formatData(char data[]){

 for(int mx=0, nx=0; (*(data+nx) != '\0'); nx++){
   if(*(data+nx) == ' '){
      //do nothing - skip over the space in the data
   }
   else {
     *(data+mx++) = *(data+nx);
   }
 }

 //don't forget to add the null terminator
 *(data+mx) = '\0';

 return;
}//end formatData()


//----------------------------------------------------------------
//Function: formCipheredMessage()
//Parameters:  CTEXT - the cipher alphabet we will use for substitution
//      MESSAGETOCIPHER - the user's message
//      enc_message - the enciphered message to be determined
//Return Type: char* - a pointer to the encoded information.
//Purpose: Encipher the user's message.
//----------------------------------------------------------------
char* formCipheredMessage(const char CTEXT[], const char
               MESSAGETOCIPHER[], char enc_message[])
{
 int length = strlen(MESSAGETOCIPHER)+1;

 int encode_value;

 for(int ix=0; ix<length; ix++){

   //test to see if we have an alphabetic character; if not,
   //simply copy it to our encrypted message - this preserves
   //characters such as ', ! etc...
   if(!isalpha(static_cast<int>(MESSAGETOCIPHER[ix]))){
     enc_message[ix] = MESSAGETOCIPHER[ix];
   }
   else {
     //valid character - the easy way to calculate the ciphered
     //character is based on the plain text's ascii character value;
     //since it has to be a capital letter, it must be in the range
     //from 65 to 90, with A represented by 65, Z by 90.  By simply
     //subtracting 65 from the encode_value (the integer representation
     //of the plaintext character), we now know what cipher character
     //to use.

     encode_value = toupper(static_cast<int>(MESSAGETOCIPHER[ix]));
     enc_message[ix] = CTEXT[encode_value-SIXTYFIVE];
   }
 }

 //return a reference to the encoded message
 return enc_message;
}//end formCipheredMessage()


//----------------------------------------------------------------
//Function: getInputType()
//Parameters: None
//Return Type: int - 0 indicates keyboard input, 1 indicates file
//       input
//Purpose: Determines if the user will be manually entering text to
//be enciphered or if the user wants a file to be enciphered.
//----------------------------------------------------------------
int getInputType(void)
{
 char type;
 bool error = false;
 int value;

 do {
  //prompt user for input from file or keyboard
  cout << "Is file input from keyboard (K, k) or file (F, f): ";
  cin >> type;

  //make type an uppercase letter
  type = static_cast<char>(toupper(static_cast<int>(type)));

  //check for an invalid character
  if((type != 'K') && (type != 'F')){
     cerr << "You have entered an invalid character!" << endl << endl;
     error = true;
  }
  else {
    if(type == 'K')
      value = 0;        //value of 0 represents keyboard input
      else value = 1;   //value of 1 represents file input
    error = false;
  }

 } while (error);

 cout << endl;

 return value;
}//end getInputType()


//----------------------------------------------------------------
//Function: getFileNames()
//Parameters:  infile_name - the input file
//      outfile_name - the output file we will write the
//      enciphered text to
//Return Type: None
//Purpose: Get file information from the user.
//----------------------------------------------------------------
void getFileNames(char * &infile_name, char * &outfile_name)
{
 char data[SIZE];

 cout << "Enter filename to store/retrieve plaintext message: ";

 cin >> data;

 infile_name = new char[strlen(data) + 1];
 strcpy(infile_name, data);

 cout << "Enter filename to store enciphered message: ";

 cin >> data;

 outfile_name = new char[strlen(data) + 1];
 strcpy(outfile_name, data);

 cout << endl;

 return;
}//end getFileNames()


//----------------------------------------------------------------
//Function: getKeyword()
//Parameters: text - the keyword that the user enters
//Return Type: int - the length of the keyword
//Purpose: Prompts the user for a keyword and continues until
//a valid keyword has been entered.  Returns the length of the
//keyword.
//----------------------------------------------------------------
int getKeyword(char * &text)
{
 bool error = false;
 char buffer[SIZE];

 do {
   cout << "Enter keyword or keyword phrase in UPPERCASE" << endl
            << "do not use spaces or non-alphabetic characters): ";

   cin.getline(buffer, SIZE, '\n');
   assert(text = new char[strlen(buffer) + 1]);
   strcpy(text, buffer);

   error = checkInput(text);

   //delete text if there was an error
   if(error){
     delete [] text;
   }

 } while (error);

 cout << endl;

 return strlen(buffer);
}//end getKeyword()


//----------------------------------------------------------------
//Function: getMessage()
//Parameters:  input - the name of the input plaintext file
//      output the name of the output ciphertext file
//      msg_to_cipher - the message to be encoded
//      PTEXT[] - the plaintext alphabet
//      CTEXT[] - the ciphertext alphabet
//Return Type: bool, indicating success of operation
//Purpose: Allow the user to manually input text from the keyboard.
//Save the text in plaintext to the input file; encrypt the text
//and save it to the specified output file for later retrieval.
//----------------------------------------------------------------
bool getMessage(char* input, char* output, char msg_to_cipher[],
                  const char PTEXT[],
         const char CTEXT[])
{
 bool go_on = true, success = false;

 ofstream textFile(input, ios::app);
 ofstream cipherFile(output, ios::app);
 if((!textFile) || (!cipherFile)){
   //do nothing - error will be noted to user later
 }
 else {

   success = true;

   textFile << "PLAINTEXT:  " << PTEXT << endl;
   textFile << "CIPHERTEXT: " << CTEXT << endl << endl;

   //get the newline character off of the input stream
   cin.get();

   cout << "Enter the message in UPPERCASE characters: " << endl;

   while (go_on) {

    //get the entire line, up to 256 characters
    cin.getline(msg_to_cipher, SIZE, '\n');

    //case user doesn't want the text to be encrypted
    if(msg_to_cipher[0] == '/'){

      if(strlen(BUFFER)>0){
        //empty whatever is in the buffer
        groupBUFFER(cipherFile, strlen(BUFFER));
        //adjust the buffer
        strcpy(BUFFER, (BUFFER+strlen(BUFFER)));
      }

      //output plaintext
      textFile << msg_to_cipher << endl;
      cipherFile << msg_to_cipher << endl;
      }

    //case user is done entering text
    else if (static_cast<int>(msg_to_cipher[0]) == NINETYTWO){
      go_on = false;
      }

    //encrypt the text
    else {
      textFile << msg_to_cipher << endl;
      char enciphered_msg[BIGSIZE];
      formCipheredMessage(CTEXT,msg_to_cipher,enciphered_msg);
      printCipherToFile(cipherFile,enciphered_msg);
      }
    }

 //empty the rest of the buffer
 groupBUFFER(cipherFile, strlen(BUFFER));
 }

 //close the files
 textFile.close();
 cipherFile.close();

 //notify user where plaintext and ciphertext files are
 cout << "\nPlaintext file is: " << input << endl;
 cout << "Encrypted file is: " << output << endl << endl;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费观看一区| 美腿丝袜亚洲一区| 91色porny| 玉米视频成人免费看| 欧美中文字幕亚洲一区二区va在线 | av一区二区三区在线| 国产精品久久久久精k8| 成人免费看黄yyy456| 亚洲欧洲av在线| 欧美三级韩国三级日本三斤| 日韩在线一区二区三区| 日韩欧美国产不卡| 国产精品123| 一级日本不卡的影视| 在线播放亚洲一区| 国产美女精品一区二区三区| 国产欧美日韩另类视频免费观看| av成人老司机| 琪琪一区二区三区| 国产农村妇女精品| 欧美午夜精品电影| 国产在线精品免费| 一二三四区精品视频| 日韩视频免费直播| 99在线热播精品免费| 日韩福利电影在线| 亚洲国产电影在线观看| 欧美日韩美女一区二区| 国产电影精品久久禁18| 夜夜精品视频一区二区| 久久婷婷国产综合精品青草 | 麻豆91精品91久久久的内涵| 国产偷国产偷亚洲高清人白洁| 色综合久久综合| 久久国产婷婷国产香蕉| 亚洲丝袜美腿综合| 精品人伦一区二区色婷婷| 91丨porny丨国产| 精品一区二区在线看| 亚洲最大成人综合| 国产日韩欧美一区二区三区乱码| 精品视频在线免费| 成人sese在线| 久久99国产乱子伦精品免费| 亚洲自拍偷拍网站| 中文在线免费一区三区高中清不卡| 欧美日本一区二区在线观看| 播五月开心婷婷综合| 久久精品噜噜噜成人88aⅴ| 夜夜精品浪潮av一区二区三区| 久久久久久夜精品精品免费| 欧美日韩一区不卡| 99riav一区二区三区| 国产精品456露脸| 日韩在线观看一区二区| 亚洲精品国产无天堂网2021| 中文字幕乱码日本亚洲一区二区 | 亚洲精品在线观看视频| 欧美日韩的一区二区| 日本韩国视频一区二区| 成人免费视频网站在线观看| 激情综合亚洲精品| 免费精品视频在线| 日本一区中文字幕| 亚洲chinese男男1069| 亚洲欧美经典视频| 国产精品久久久一本精品 | 欧美高清一级片在线| 97se狠狠狠综合亚洲狠狠| 国产激情视频一区二区在线观看 | 欧美日韩在线播放三区| 91麻豆精东视频| 成人avav影音| 成人午夜免费视频| 国产成人福利片| 国产成人免费9x9x人网站视频| 久久99这里只有精品| 久久成人久久鬼色| 国产一区二区三区黄视频 | www亚洲一区| 精品国产污污免费网站入口| 日韩欧美成人激情| 91精品国产黑色紧身裤美女| 7777精品伊人久久久大香线蕉的 | 韩国女主播一区二区三区| 久久97超碰色| 国产综合久久久久影院| 国内外成人在线| 国产成人亚洲综合a∨猫咪| 国产成人av电影| a亚洲天堂av| 欧洲一区二区三区免费视频| 欧美三级日韩在线| 日韩一级二级三级| 久久久久久久精| 国产精品久久久久久久久晋中| 亚洲摸摸操操av| 视频一区欧美精品| 狠狠狠色丁香婷婷综合激情| 国产不卡视频在线观看| youjizz国产精品| 色欧美日韩亚洲| 91精品在线观看入口| 欧美大片一区二区三区| 国产日本一区二区| 一区二区成人在线视频| 青青草国产精品亚洲专区无| 国产精品一区二区久激情瑜伽| 白白色 亚洲乱淫| 91精品国产综合久久蜜臀| 日韩欧美久久久| 国产欧美一区二区精品忘忧草| 亚洲欧美乱综合| 捆绑紧缚一区二区三区视频| 丁香婷婷综合激情五月色| 99久久精品久久久久久清纯| 精品污污网站免费看| 国产日韩一级二级三级| 亚洲综合精品久久| 国产一区二区三区免费| 欧美性大战久久久久久久蜜臀| 日韩精品在线一区二区| 亚洲三级久久久| 激情五月婷婷综合| 一本大道久久a久久精二百| 精品女同一区二区| 国产精品久久三| 久久99精品久久久久| 91精品91久久久中77777| 久久综合国产精品| 亚洲在线中文字幕| 国产a级毛片一区| 欧美一级理论片| 亚洲精品免费播放| 国产剧情在线观看一区二区| 在线观看免费亚洲| 欧美高清一级片在线观看| 青青草97国产精品免费观看无弹窗版| 成人黄色电影在线| 久久久久久久综合| 日韩精品久久理论片| 一本大道综合伊人精品热热| 国产亚洲婷婷免费| 麻豆精品久久精品色综合| 在线视频观看一区| 国产精品精品国产色婷婷| 黄一区二区三区| 91麻豆精品国产91久久久久久| 亚洲人成7777| 成人av电影在线| 国产精品日韩精品欧美在线| 紧缚捆绑精品一区二区| 欧美一区二区三区的| 亚洲国产精品久久艾草纯爱| 色综合久久久久久久| 国产精品久久久久三级| 成人一级片网址| 国产日产亚洲精品系列| 国产成人欧美日韩在线电影| 欧美精品一区二区三区在线| 麻豆91在线看| 欧美成人性福生活免费看| 日韩一区精品视频| 4438x亚洲最大成人网| 亚洲va中文字幕| 欧美色精品在线视频| 亚洲影院在线观看| 欧美午夜电影在线播放| 亚洲成人动漫一区| 欧美剧情电影在线观看完整版免费励志电影| 亚洲色图视频网站| 在线中文字幕不卡| 亚洲一区av在线| 91麻豆精品国产| 美日韩一区二区| 欧美成人aa大片| 国产一区二区在线看| 欧美激情在线一区二区三区| 国产成人在线观看免费网站| 国产精品成人在线观看| 色中色一区二区| 污片在线观看一区二区| 91麻豆精品国产无毒不卡在线观看 | 欧美激情一区二区在线| 丁香婷婷深情五月亚洲| 亚洲欧洲综合另类| 欧美三级韩国三级日本一级| 日本欧美韩国一区三区| 欧美精品一区二区三区一线天视频 | 免费成人结看片| 久久男人中文字幕资源站| 成人一区在线看| 亚洲与欧洲av电影| 日韩一区和二区| 国产福利一区二区三区视频| 18成人在线视频| 在线不卡免费av| 国产乱子轮精品视频| 亚洲黄色尤物视频| 欧美成人在线直播|