rc4加密算法的实现_网络安全课程设计(编辑修改稿)内容摘要:

src,100)。 CString strSrc( ,101)。 (%s,strSrc)。 if(()) { MessageBox(请输入你要加密的字符串。 ,NULL,MB_OK)。 return。 } (src,key,(int)strlen(key),(int)strlen(src))。 (src)。 到上面那部分 打开文件: CString lpszFilter=text file (*.txt)|*.txt|Microsoft doc (*.doc)|*.doc|Data Files (*.xlc。 *.xls)|*.xlc。 *.xls|All Files (*.*)|*.*||。 CString readBuf( ,1000)。 CString lpszDefExt=.txt。 CString lpszFileName=*.txt。 char *ch1=new char。 char ch[9]。 ::memset((void *)ch,0,9)。 char str[200]。 ::memset((void *)str,0,200)。 CFileDialog *fileOpen=new CFileDialog( true, lpszDefExt, lpszFileName, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, lpszFilter, NULL )。 if(!fileOpenDoModal()) { MessageBox(Open failly!,NULL,MB_OK)。 return。 } CString filePath=fileOpenGetPathName()。 (LPCTSTR(filePath))。 保存文件: CString lpszFilter=text file (*.txt)|*.txt|Microsoft doc (*.doc)|*.doc|Data Files (*.xlc。 *.xls)|*.xlc。 *.xls|All Files (*.*)|*.*||。 CString lpszDefExt=.txt。 CString lpszFileName=*.txt。 CFileDialog *fileSave=new CFileDialog( false, lpszDefExt, lpszFileName, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, lpszFilter, NULL )。 CFile cFile。 if(!fileSaveDoModal()) { MessageBox(failed!,NULL,MB_OK)。 return。 } CArchive ar(amp。 cFile,CArchive::load)。 CString filePath=fileSaveGetPathName()。 (filePath)。 if((LPCTSTR(filePath),CFile::modeCreate|CFile::modeWrite)==0) { MessageBox(Open failly!,NULL,MB_OK)。 return。 } 文件加密: char key[256]。 ::memset((void *)key,39。 39。 ,256)。 char ch[101]。 ::memset((void *)ch,39。 39。 ,101)。 (key,strlen(key))。 CString key1。 (%s,key)。 if(()) { MessageBox(你还没有输入密钥。 ,NULL,MB_OK)。 return。 } CString srcFilePath( ,200)。 (srcFilePath)。 if(()) { MessageBox(你还没有选择源文件 ,NULL,MB_OK)。 return。 } CFile srcFile。 if((LPCTSTR(srcFilePath),CFile::modeRead)==0) { MessageBox(源文件打开失败 !,NULL,MB_OK)。 return。 } CArchive srcAr(amp。 srcFile,CArchive::load)。 int fileLen=()。 CString detFilePath( ,200)。 (detFilePath)。 if(()) { MessageBox(你还没有选择目标文件 ,NULL,MB_OK)。 return。 } CFile detFile。 if((LPCTSTR(detFilePath),CFile::modeCreate|CFile::modeWrite)=。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。