- 关 键 词:
package com.elong.application.encrypt;<br>
public class Crypt<br>
{ <br>
static int sub[] = new int[48];<br>
<br>
// TABLES<br>
/* Expansion table (32 to 48) */<br>
int E_p[] = {<br>
32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9,<br>
8, 9,10,11,12,13,12,13,14,15,16,17,<br>
16,17,18,19,20,21,20,21,22,23,24,25,<br>
24,25,26,27,28,29,28,29,30,31,32, 1<br>
};<br>
<br>
/* Permutation Choice 1 for subkey generation (64/56 to 56) */<br>
int PC1_p[] = {<br>
57,49,41,33,25,17, 9, 1,58,50,42,34,26,18,<br>
10, 2,59,51,43,35,27,19,11, 3,60,52,44,36,<br>
63,55,47,39,31,23,15, 7,62,54,46,38,30,22,<br>
14, 6,61,53,45,37,29,21,13, 5,28,20,12, 4<br>
};<br>
<br>
/* Permutation Choice 2 for subkey generation (56 to 48) */<br>
int PC2_p[] = {<br>
14,17,11,24, 1, 5, 3,28,15, 6,21,10,<br>
23,19,12, 4,26, 8,16, 7,27,20,13, 2,<br>
41,52,31,37,47,55,30,40,51,45,33,48,<br>
44,49,39,56,34,53,46,42,50,36,29,32<br>
};<br>
<br>
/* Number of rotations for the iteration of key scheduling */<br>
/* The concept of a table here doesn't fit our behavioral model */<br>
/* This will be logic in our final design */<br>
int keyrots[] = {1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1};<br>
<br>
/* Selection blocks<br>
* There are 8 sblocks, each of which is referenced by a 2 bit value<br>
* which picks the row, and a 4 bit value which picks the column<br>
* This number is then the 4 bit output for that select block<br>
*/<br>
int sblocks[][][] = {<br>
{ { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 },<br>
{ 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 },<br>
{ 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 },<br>
{ 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 }<br>
},<br>
<br>
{ { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 },<br>
{ 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 },<br>
{ 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 },<br>
{ 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 }<br>
},<br>
<br>
{ { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 },<br>
{ 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },<br>
{ 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 },<br>
{ 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 }<br>
},<br>
<br>
{ { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 },<br>
&来自:http://www.qqread.com/jsp/z238693.html进入讨论组讨论。
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- 在JSP中如何实现MD5加密 (702次浏览)
- 如何入侵jsp网站 (634次浏览)
- JSP学习笔记(一)-----概述 (602次浏览)
- 安装配置篇(一)---Apache+Tomcat (584次浏览)
- 全面解析JDBC (550次浏览)
- 开发一个调试JSP的Eclipse插件 (538次浏览)
- 一个经典的ADO.NET入门例子 (341次浏览)
- swing布局设计及事件监听和javabean数据管理 (326次浏览)
- Windows下JSP开发环境的配置 (156次浏览)
- 最重要的 10 几个 J2EE 最佳实践 (153次浏览)



