资源简介
作为一种比较新的加密算法, 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
相关资源
- 16*64点阵滚动显示汉字原理图及算法,
- FastSLAM算法模型
- x86汇编四则表达式混合运算
- 直线段剪裁算法实现
- 天线选择算法
- 何恺明 暗原色先验图像去雾算法 导向
- s/key协议及部分加密算法
- 加减速算法
- 编程实现中点分割裁剪算法,显示裁
- 点云配准SIFT算法
- 压缩传感的四种重构算法
- 机器学习算法,包含随机森林,决策
- 一种简单有效的求解TSP的混合差分进
- 时间片轮转调度算法
- 匈牙利算法及程序
- 多目标问题RM-MOEAMOEAD的改进版,by张青
- 机器人避障算法
- 基于mmse的信道估计算法
- Cohen-Sutherland算法
- SIFT+LBP算法实现代码
- Bezier曲线的算法描述及其程序实现
- 黑白棋AI算法
- DES算法代码
- cocos2dx +lua 斜45度A星寻路算法
- 深度学习的最优化:理论和算法综述
- 读狗工具(用于对付常用的加密狗
- 遗传算法(三角形判定)
- GPS LAMBDA算法
- 数据结构实验七排序算法的实现题目
- delphi编写的数独递归算法
评论
共有 条评论