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

📄 indexvector.java

📁 JAVA语言编写的用于DES/3DES算法加密与解密的程序
💻 JAVA
字号:
package Security_DES;

public class indexVector {

//初始转换IP
protected static final byte[] replaceId = new byte[]{   58,50,42,34,26,18,10,2,
                                                            60,52,44,36,28,20,12,4,
                                                            62,54,46,38,30,22,14,6,
                                                            64,56,48,40,32,24,16,8,
                                                            57,49,41,33,25,17,9 ,1,
                                                            59,51,43,35,27,19,11,3,
                                                            61,53,45,37,29,21,13,5,
                                                            63,55,47,39,31,23,15,7 };
//扩展48位IP                                 
protected static final byte[] extendId = new byte[]{    32,1 ,2 ,3 ,4 ,5 ,
                                                            4 ,5 ,6 ,7 ,8 ,9 ,
                                                            8 ,9 ,10,11,12,13,
                                                            12,13,14,15,16,17,
                                                            16,17,18,19,20,21,
                                                            20,21,22,23,24,25,
                                                            24,25,26,27,28,29,
                                                            28,29,30,31,32,1 };
//P盒IP                              
protected static final byte[] PBoxId = new byte[]{      9 ,17,23,31,
                                                            13,28,2 ,18,
                                                            24,16,30,6 ,
                                                            26,20,10,1 ,
                                                            8 ,14,25,3 ,
                                                            4 ,29,11,19,
                                                            32,12,22,7 ,
                                                            5 ,27,15,21 }; 
//逆转换IP                                                       
protected static final byte[] IP_1 = new byte[]{        40,8,48,16,56,24,64,32,
                                                            39,7,47,15,55,23,63,31,
                                                            38,6,46,14,54,22,62,30,
                                                            37,5,45,13,53,21,61,29,
                                                            36,4,44,12,52,20,60,28,
                                                            35,3,43,11,51,19,59,27,
                                                            34,2,42,10,50,18,58,26,
                                                            33,1,41, 9,49,17,57,25};
//S盒值                               
protected static final String[][] S ={           { "1110","0000","0100","1111","1101","0111","0001","0100", //7
                                                      "0010","1110","1111","0010","1011","1101","1000","0001",//15
                                                      "0011","1010","1010","0110","0110","1100","1100","1011",//23
                                                      "0101","1001","1001","0101","0000","0011","0111","1000",//31
                                                      "0100","1111","0001","1100","1110","1000","1000","0010",//39
                                                      "1101","0100","0110","1001","0010","0001","1011","0111",//47
                                                      "1111","0101","1100","1011","1001","0011","0111","1110",//55
                                                      "0011","1010","1010","0000","0101","0110","0000","1101" },//63 S1
                                                    { "1111","0011","0001","1101","1000","0100","1110","0111",//7
                                                      "0110","1111","1011","0010","0011","1000","0100","1110",//15
                                                      "1001","1100","0111","0000","0010","0001","1101","1010",//23
                                                      "1100","0110","0000","1001","0101","1011","1010","0101",//31
                                                      "0000","1101","1110","1000","0111","1010","1011","0001",//39
                                                      "1010","0011","0100","1111","1101","0100","0001","0010",//47
                                                      "0101","1011","1000","0110","1100","0111","0110","1100",//55
                                                      "1001","0000","0011","0101","0010","1110","1111","1001" },//63 S2
                                                    { "1010","1101","0000","0111","1001","0000","1110","1001",//7
                                                      "0110","0011","0011","0100","1111","0110","0101","1010",//15
                                                      "0001","0010","1101","1000","1100","0101","0111","1110",//23
                                                      "1011","1100","0100","1011","0010","1111","1000","0001",//31
                                                      "1101","0001","0110","1010","0100","1101","1001","0000",//39
                                                      "1000","0110","1111","1001","0011","1000","0000","0111",//47
                                                      "1011","0100","0001","1111","0010","1110","1100","0011",//55
                                                      "0101","1011","1010","0101","1110","0010","0111","1100" },//63  S3
                                                    { "0111","1101","1101","1000","1110","1011","0011","0101",//7
                                                      "0000","0110","0110","1111","1001","0000","1010","0011",//15
                                                      "0001","0100","0010","0111","1000","0010","0101","1100",//23
                                                      "1011","0001","1100","1010","0100","1110","1111","1001",//31
                                                      "1010","0011","0110","1111","1001","0000","0000","0110",//39
                                                      "1100","1010","1011","0001","0111","1101","1101","1000",//47
                                                      "1111","1001","0001","0100","0011","0101","1110","1011",//55
                                                      "0101","1100","0010","0111","1000","0010","0100","1110" },//63  S4
                                                    { "0010","1110","1100","1011","0100","0010","0001","1100",//7
                                                      "0111","0100","1010","0111","1011","1101","0110","0001",//15
                                                      "1000","0101","0101","0000","0011","1111","1111","1010",//23
                                                      "1101","0011","0000","1001","1110","1000","1001","0110",//31
                                                      "0100","1011","0010","1000","0001","1100","1011","0111",//39
                                                      "1010","0001","1101","1110","0111","0010","1000","1101",//47
                                                      "1111","0110","1001","1111","1100","0000","0101","1001",//55
                                                      "0110","1010","0011","0100","0000","0101","1110","0011" },//63  S5
                                                    { "1100","1010","0001","1111","1010","0100","1111","0010",//7
                                                      "1001","0111","0010","1100","0110","1001","1000","0101",//15
                                                      "0000","0110","1101","0001","0011","1101","0100","1110",//23
                                                      "1110","0000","0111","1011","0101","0011","1011","1000",//31
                                                      "1001","0100","1110","0011","1111","0010","0101","1100",//39
                                                      "0010","1001","1000","0101","1100","1111","0011","1010",//47
                                                      "0111","1011","0000","1110","0100","0001","1010","0111",//55
                                                      "0001","0110","1101","0000","1011","1000","0110","1101" },//63  S6
                                                    { "0100","1101","1011","0000","0010","1011","1110","0111",//7
                                                      "1111","0100","0000","1001","1000","0001","1101","1010",//15
                                                      "0011","1110","1100","0011","1001","0101","0111","1100",//23
                                                      "0101","0010","1010","1111","0110","1000","0001","0110",//31
                                                      "0001","0110","0100","1011","1011","1101","1101","1000",//39
                                                      "1100","0001","0011","0100","0111","1010","1110","0111",//47
                                                      "1010","1001","1111","0101","0110","0000","1000","1111",//55
                                                      "0000","1110","0101","0010","1001","0011","0010","1100" },//63  S7
                                                    { "1101","0001","0010","1111","1000","1101","0100","1000",//7
                                                      "0110","1010","1111","0011","1011","0111","0001","0100",//15
                                                      "1010","1100","1001","0101","0011","0110","1110","1011",//23
                                                      "0101","0000","0000","1110","1100","1001","0111","0010",//31
                                                      "0111","0010","1011","0001","0100","1110","0001","0111",//39
                                                      "1001","0100","1100","1010","1110","1000","0010","1101",//47
                                                      "0000","1111","0110","1100","1010","1001","1101","0000",//55
                                                      "1111","0011","0011","0101","0101","0110","1000","1011" }//63  S8
                                                      
                                        };
}
                            

⌨️ 快捷键说明

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