云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > DES加密算法实现论文

DES加密算法实现论文

  • 62 次阅读
  • 3 次下载
  • 2025/6/23 20:25:11

}

void CTJUT_DES_TOOLDlg::OnRadioFile() {

// TODO: Add your control notification handler code here Fromwhich=FROMFILE;

myeditfile.EnableWindow(TRUE); myeditchar.EnableWindow(FALSE); myedithex.EnableWindow(FALSE); myopenfile.EnableWindow(TRUE); }

void CTJUT_DES_TOOLDlg::OnRadioHex() {

// TODO: Add your control notification handler code here Fromwhich=FROMHEX;

myeditfile.EnableWindow(FALSE); myeditchar.EnableWindow(FALSE); myedithex.EnableWindow(TRUE); myopenfile.EnableWindow(FALSE); }

void CTJUT_DES_TOOLDlg::OnCancel() {

// TODO: Add extra cleanup here

CDialog::OnCancel(); }

void CTJUT_DES_TOOLDlg::OnOK() {

// TODO: Add extra validation here

//CDialog::OnOK(); return; }

void CTJUT_DES_TOOLDlg::OnButtonCompute1() {

// TODO: Add your control notification handler code here CString oStr,oStrpwd,oStrpwdc; int iLen;

unsigned char pt[8];//=static_cast(_alloca(iLen));

myeditpwd.GetWindowText(oStrpwd); myeditpwdc.GetWindowText(oStrpwdc); if(oStrpwd.Compare(LPCTSTR(oStrpwdc))) { myeditresult.SetWindowText(\密钥设置不一致!请重新设置。\ return; }

if(oStrpwd.GetLength()!=16) { myeditresult.SetWindowText(\密钥长度不对!请重新设置。\ return; }

iLen = oStrpwd.GetLength()/2;

char* pcDatapwd = static_cast(_alloca(iLen));

Hex2Binary(LPCTSTR(oStrpwd), reinterpret_cast(pcDatapwd), iLen); oDES.setkey(reinterpret_cast(pcDatapwd));

switch(Fromwhich) {

case FROMCHAR: { myeditchar.GetWindowText(oStr); if(oStr.GetLength()!=8) { myeditresult.SetWindowText(\密文长度不对!请重新输入。\ return; } char* pcData = static_cast(_alloca(8)); memcpy(pcData,LPCTSTR(oStr),8); oDES.dectransform(reinterpret_cast(pcData), pt); //Display the result char acHex[129] = {0}; Binary2Hex(reinterpret_cast(pt), 8, acHex); myeditresult.SetWindowText(acHex); break; }

case FROMHEX: { myedithex.GetWindowText(oStr); if(oStr.GetLength()!=16) { myeditresult.SetWindowText(\密文长度不对!请重新输入。\ return;

} iLen = oStr.GetLength()/2; char* pcData = static_cast(_alloca(iLen)); Hex2Binary(LPCTSTR(oStr), reinterpret_cast(pcData), iLen); oDES.dectransform(reinterpret_cast(pcData), pt); //Display the result char acHex[129] = {0}; Binary2Hex(reinterpret_cast(pt), 8, acHex); myeditresult.SetWindowText(acHex); break; }

case FROMFILE: { CString oStrFile; myeditfile.GetWindowText(oStrFile); if (oStrFile.IsEmpty()) { myeditfile.SetWindowText(\请输入文件名!\ myeditresult.SetWindowText(\ return; } try { CString oStrFile1; oStrFile1=oStrFile+\ oDES.decfile(oStrFile,oStrFile1); myeditresult.SetWindowText(LPCTSTR(oStrFile=\解密后的文件是:\ } catch(exception const& roException) { MessageBox(CString(roException.what()), g_oStrError, MB_OK|MB_ICONERROR); return; } break; } } }

搜索更多关于: DES加密算法实现论文 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

} void CTJUT_DES_TOOLDlg::OnRadioFile() { // TODO: Add your control notification handler code here Fromwhich=FROMFILE; myeditfile.EnableWindow(TRUE); myeditchar.EnableWindow(FALSE); myedithex.EnableWindow(FALSE); myopenfile.EnableWindow(TRUE); } void CTJUT_DES_TOOLDlg::OnRadioHex() { // TODO: Add your control notification handler code here

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com