资源简介

代码片段和文件信息
/*************************************************************************/
/*
/* Describe : ADFGVX Cipher Function
/* Input key and plaintext
/* Transform key into a matrix of 5*5
/* Author : ZongNanYaoFengyi
/* Date : 2009 - 7 - 23 13:09
/*
/*************************************************************************/
#include “string.h“
#include “ctype.h“
#include “stdlib.h“
#include “stack-c.h“
int ADFGVX(char *keychar *ciphertext)
{
int ijk; //Define cycle control variables
char Location[6] = {‘A‘‘D‘‘F‘‘G‘‘V‘‘X‘}; // Define look-up table used to locate coordinate
int row; // Row coordinates
int grade; //Column coordinates
int plaintextLength;
int ciphertextLength;
char *plaintext;
ciphertextLength = strlen(ciphertext); //Compute length
plaintext = (char *)malloc(ciphertextLength+1); // Encryption for every letter
strcpy(plaintextciphertext);
plaintextLength = strlen(plaintext);
for(i = 0k = 0;i < plaintextLength;i ++k += 2)
{
if(plaintext[i] == ‘ ‘)
{
k -= 2;
continue; // Filter Spaces
}
for(j = 0;j < 36;j ++)
if(key[j] == tolower(plaintext[i]))
break; // Search the letter in the alphabet
row = j / 6;
grade = j % 6;
ciphertext[k] = Location[row];
ciphertext[k + 1] = Location[grade];
}
ciphertext[k] = ‘\0‘;
free(plaintext);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1696 2009-08-20 11:22 ADFGVX.c
文件 1689 2009-08-23 00:09 ADFGX.c
文件 1139 2009-08-23 00:09 Affine.c
文件 1539 2009-08-20 11:21 Beaufort.c
文件 1516 2009-08-20 11:21 Box.c
文件 1313 2009-08-22 11:22 Caesar.c
文件 1249 2009-08-22 11:25 CharSingTabRe.c
文件 1592 2009-08-20 11:19 DeADFGVX.c
文件 1418 2009-08-23 00:23 DeADFGX.c
文件 1242 2009-08-22 11:26 DeAffine.c
文件 1381 2009-08-20 11:07 DeBeaufort.c
文件 1564 2009-08-20 11:08 DeBox.c
文件 1381 2009-08-22 11:26 DeCaesar.c
文件 1049 2009-08-22 11:27 DeCharSingTabRe.c
文件 1143 2009-08-22 11:28 DeGCaesar.c
文件 1430 2009-08-20 11:20 DeMultiplicator.c
文件 2756 2009-08-23 00:25 DePlayfair.c
文件 1964 2009-08-22 11:33 DeSingTabRe.c
文件 2803 2009-08-20 11:19 DeTranspose.c
文件 1450 2009-08-23 00:04 DeVigenere.c
文件 1141 2009-08-22 11:31 GCaesar.c
文件 1280 2009-08-20 11:06 Multiplicator.c
文件 3496 2009-08-23 00:10 Playfair.c
文件 2071 2009-08-22 11:33 SingleTableRe.c
文件 2329 2009-08-23 00:37 Transpose.c
文件 1505 2009-08-20 11:03 Vigenere.c
----------- --------- ---------- ----- ----
43136 26
- 上一篇:c++/mfc编写的网络电话,网络语音 程序
- 下一篇:有限元的C语言实现计算
相关资源
- 3des加密算法C语言实现
- DES加密算法C语言实现
- C语言实现的DES对称加密算法
- 国密SM4加密_2020
- aes加解密(vc源程序)
- C++ SHA256加密计算
- BlowFish加密算法
-
STM32-ba
se64加密源代码 - VProtect+注册机.rar
- VC++实现RSA加密算法
- dsp课程设计——语音加密.zip
- C++实现RSA加密解密算法
- 多表代换 加密解密 C语言实现
- 椭圆曲线ECC加密解密算法的c语言实现
- hill密码的加密、解密以及破译.zip
- c++实现ECC加解密
- C语言实现凯撒和维吉尼亚加解密
- C++实现AES、DES加密算法含MFC界面
- 3DES加密算法C++实现
- DES/3DES算法C语言实现
- DES和3DES加密算法,C语言,适用于单片
- 各种加密算法C语言版
- SM4(ECB、CBC、CTR、CFB、OFB)加密算法
- RSA算法纯C语言代码实现,带测试dem
- sm2算法源码实现
- DES算法C++实现.rar
- OpenSSL RSA 非对称加密(VS2013,C++实现
- DES文件加密解密系统 密码学课设
- AES 加密 C++源码
- c语言+UDP+DES加密+socket编程
评论
共有 条评论