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

📄 bench.cpp

📁 idea算法从speakfs提取
💻 CPP
字号:
#define BENCHMARK	200

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>

#include "idea.h"

void print(unsigned char *cp,char *s){
    printf("\n%s\n",s);
	printf("Begin-----String:!\n");
	int len, i =0 ;
	len = strlen((char*)cp);
    while ( len-- )
    {
		printf("%c",cp[i] & 0xff);
		i++;
    }
	printf("\nlength=%d\n",i);
	printf("End-------String!\n");
}
void main()
{
	unsigned short iv1[8],iv2[8];
	unsigned char key[] = "Cobble dsdsdw ds";
	static unsigned char buffer[] = "good byehello megoodbyehello megood 地方byehello megood byehello megood byehello megood byehello megood byehello megood byehello megoodbyehello megood byehello megood byehello megood byehello megood byehello me";
	print(key, "key:");
	print(buffer, "原文:");

	initcfb_idea(iv1, key, FALSE);   //false为加密 true为解密 
	ideacfb(buffer, sizeof buffer);
	print(buffer, "密文:");

	initcfb_idea(iv2, key, TRUE);
	ideacfb(buffer, sizeof buffer);
	print(buffer, "明文:");

 }

⌨️ 快捷键说明

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