移位加密解密代码(Shift encryption and decryption code).doc
《移位加密解密代码(Shift encryption and decryption code).doc》由会员分享,可在线阅读,更多相关《移位加密解密代码(Shift encryption and decryption code).doc(12页珍藏版)》请在三一文库上搜索。
1、移位加密解密代码(Shift encryption and decryption code)File encryption and decryption / / / /#include#include#includeM digital #define M 1000 / preset a specified file size, to facilitate future changeVoid, Yiwei ();Void, menu ();Void, main ()Int a;Menu ();While (a, =2)Scanf (%d, &a);Switch (a)Case, 1:, Yiwe
2、i (); break;Case, 2:, printf (n, thanks for using nn ); break;Default:Printf (n input error, please re-enter n);System (CLS);Menu (); break;The main function of the end of */ /*/* call shift encryption and decryption function */Void, Yiwei ()FILE * infile=NULL; / / pointer input fileFILE * outfile=N
3、ULL; / / output file pointerInt key, keyc, key1; / / keyInt operation=0; / / the type of operation, -1 encryption, decryption -2Char, filename100, data;While (1)Infile=outfile=NULL;Operation=0;Select the type of operation.While (operation=1|operation=2)Printf (please select encrypt -1 decrypt -2:);S
4、canf (%d, &operation);The handling of illegal input / /If (operation=1|operation=2)Printf (wrong choice, please re select n );/ / open input fileWhile (infile=NULL)Printf (n enter the name of the file file to be opened (full path):);Scanf (%s, filename);/ / open read-only file streamInfile=fopen (fi
5、lename, R);/ / open file flow failure, enter the file name againIf (infile=NULL)Printf (n cannot open the file. Please check if the file exists, and then re-enter it.);/ / input keyPrintf (n enter key:);Scanf (%d, &key);Keyc=key/26;Key=key%26;If (operation=1)Printf (n enter the name of the saved enc
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 移位加密解密代码Shift encryption and decryption code 移位 加密 解密 代码 Shift code
链接地址:https://www.31doc.com/p-8876907.html