本文整理汇总了C++中DES::MainDES方法的典型用法代码示例。如果您正苦于以下问题:C++ DES::MainDES方法的具体用法?C++ DES::MainDES怎么用?C++ DES::MainDES使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DES
的用法示例。
在下文中一共展示了DES::MainDES方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_ButtonDecrypt_clicked
void Dialog::on_ButtonDecrypt_clicked()
{ if(!inputFileName.isEmpty()\
&& !keyFileName.isEmpty()\
&& !outputFileName.isEmpty())
if(inputFile.open(QIODevice::ReadOnly)\
&& keyFile.open(QIODevice::ReadOnly)\
&& outputFile.open(QIODevice::WriteOnly))
{ pinputFile = &inputFile;
pkeyFile = &keyFile;
poutputFile = &outputFile;
pvectorFile = NULL;
if(ModeIndex)
{if(!vectorFileName.isEmpty())
{if(vectorFile.open(QIODevice::ReadOnly))
{pvectorFile = &vectorFile;}
else
{ui->textBrowser->insertPlainText("Files open error\n");
exit(0);}}
else
{ui->textBrowser->insertPlainText("One or more files are missing\n");
exit(0);}}
DES desMetod;
desMetod.EncryptDecryptFlag=0;
desMetod.ModeIndex=ModeIndex;
if(desMetod.MainDES(pinputFile,pkeyFile,poutputFile,pvectorFile))
ui->textBrowser->insertPlainText(desMetod.ErrorStr);
else
ui->textBrowser->insertPlainText("Decrypt success\n");
inputFile.close();
keyFile.close();
outputFile.close();
inputFileName = "";
keyFileName = "";
outputFileName = "";
ui->LabelSelectInputFile->setText("Select input file");
ui->LabelSelectKeyFile->setText("Select key file");
ui->LabelSelectOutputFile->setText("Select output file");
if(ModeIndex)
{ vectorFile.close();
vectorFileName = "";
ui->LabelSelectVectorFile->setText("Select vector file");}}
else
ui->textBrowser->insertPlainText("Files open error\n");
else
ui->textBrowser->insertPlainText("One or more files are missing\n");}