⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 des.c

📁 des在windows平台下得实现
💻 C
字号:
 #include "des.h"
#include "iostream.h"
#include <stdio.h>
#include <string.h>

void main()
{
	char iPath[100], oPath[100];
	int i,f=0;
	char keyString[8];
	int key[64];

	while(1)
	{
		cout<<"Please Choose Operation:\n1: Input Key\n2: Encrypt\n3: Decrypt\n4: Eixt\n"<<endl<<"Choice>";
		cin>>i;
		if(i!=4 && i!=1)
		{
			cout<<"File Path>";
			cin>>iPath;
			cout<<"Save Path>";
			cin>>oPath;
		}
		switch(i)
		{
		case 1:
			cout<<"Input Key>";
			cin>>keyString;
			toBinary(keyString, key);
			setKey(key);	
			f=1;
			break;
		case 2:
			if(!f)
			{
				cout<<f<<"ERROR: No Key Input!"<<endl;
				break;
			}
			encypher(iPath, oPath);
			break;
		case 3:
			if(!f)
			{
				cout<<"ERROR: No Key Input!"<<endl;
				break;
			}
			decypher(iPath, oPath);
			break;
		case 4:
		default:
			return;
		}
		cout<<endl;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -