资源简介
作为一种比较新的加密算法, PRESENT具有许多优异的特性。对它的研究能够很好的启发学生对密码学的认识。
代码片段和文件信息
// Present.cpp : Defines the entry point for the console application.
//
/*
* Copyright (c) 2010 Department of Computer Engineering Ordnance Engineering College
* All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Department of Computer Engineering
* Ordnance Engineering College nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT
* INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING
* BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
* LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* The core function of PRESENT block cipher.
*
* @author Xinjie ZHAO
* @Email zhaoxinjieem@163.com
* @date May 20 2010
*/
#include “stdafx.h“
#include “stdlib.h“
#include
#include
typedef unsigned char Byte;
static const Byte Sbox[16] = {
0x0c 0x05 0x06 0x0b
0x09 0x00 0x0a 0x0d
0x03 0x0e 0x0f 0x08
0x04 0x07 0x01 0x02
};
static const Byte DSbox[16] = {
0x050x0e 0x0f 0x08
0x0c0x01 0x02 0x0d
0x0b0x04 0x06 0x03
0x000x07 0x09 0x0a
};
static Byte Px[64]={
0163248117334921834503193551
4203652521375362238547233955
824405692541571026425811274359
12284460132945611430466215314763
};
static Byte rPx[64]={
04812162024283236404448525660
15913172125293337414549535761
261014182226303438424650545862
371115192327313539434751555963
};
static Byte testPx[8]={
76543210
};
void printblock(const Byte *bint nlenth)
{
for(int i=0;i printf(“%2x “ b[i]);
}
//S盒
void Sub_bytes(Byte *s)
{
Byte t[16];
int i;
memset(t016);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6249 2011-05-02 22:01 PRESENT(2007年提出).cpp
相关资源
- 温度传感器DS18B20序列号批量搜索算法
- 多传感器标定算法
- 易语言极速文本加密解密模块V3.1模块
- 易语言加解密例程源码易语言生成随
- 易语言加密记事本简单例程源码
- 希尔密码加密、解密和破密
- PNG加密解密工具73383
- m1卡 ic卡可选择扇区初始化加密软件
- SVR算法程序可运行
- 计算机图形学 边填充算法实现代码
- Zprotect专业版(无限制) 一机一码E
- 福建师范大学历年算法考卷
- 栈的实现及应用,六种基本算法
- 加密软件漏洞评测系统 V8.9
- Bresenham算法绘制线段并利用“橡皮筋
- 介绍几种压缩算法及《笨笨数据压缩
- 改进的BP神经网络算法
- C 大整数RSA加密
- [免费]安全加密软件U盘加密,文件加
- A星算法_原理讲解_例子
- 加密cad图形的lisp文件
- 云模型的相关算法cloud
- 旋转矩阵求欧拉角的简单算法
- 栅栏填充算法源码(VC)
- RSA算法源码
- 关联分析Apriori算法实现
- [免费]relax算法成像
- 操作系统 LRU算法 实验报告 及 程序代
- 透明加密源码及说明
- 分治法快速排序算法QuickSort C
川公网安备 51152502000135号
评论
共有 条评论