1 / 12
文档名称:

AES加密java实现.doc

格式:doc   大小:49KB   页数:12页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

AES加密java实现.doc

上传人:yuzonghong1 2017/2/23 文件大小:49 KB

下载得到文件列表

AES加密java实现.doc

文档介绍

文档介绍:// 复制下来命名为 Rijndael .java 直接可以运行 public class Rijndael { public Rijndael() {} /** * Flag to setup the encryption key schedule. */ public static final int DIR_ENCRYPT = 1; /** * Flag to setup the decryption key schedule. */ public static final int DIR_DECRYPT = 2; /** * Flag to setup both key schedules (encryption/decryption). */ public static final int DIR_BOTH = (DIR_ENCRYPT | DIR_DECRYPT); /** * AES block size in bits (. the Rijndael algorithm itself allows for * other sizes). */ public static final int BLOCK_BITS = 128; /** * AES block size in bytes (. the Rijndael algorithm itself allows for * other sizes). */ public static final int BLOCK_SIZE = (BLOCK_BITS >>> 3); /** * Substitution table (S-box). */ private static final String SS= "/u637C/u777B/uF26B/u6FC5/u3001/u672B/uFED7/uAB76" + "/uCA82/uC97D/uFA59/u47F0/uADD4/uA2AF/u9CA4/u72C0" + "/uB7FD/u9326/u363F//u34A5/uE5F1/u71D8/u3115" + "/u04C7/u23C3/u1896/u059A/u0712/u80E2/uEB27/uB275" + "/u0983/u2C1A/u1B6E/u5AA0/u523B/uD6B3/u29E3/u2F84" + "/u53D1/u00ED/u20FC/uB15B/u6ACB/uBE39/u4A4C/u58CF" + "/uD0EF/uAAFB/u434D/u3385/u45F9/u027F/u503C/u9FA8" + "/u51A3/u408F/u929D/u38F5/uBCB6/uDA21/u10FF/uF3D2" + "/uCD0C/u13EC/u5F97/u4417/uC4A7/u7E3D/u645D/u1973" + "/u6081/u4FDC/u222A/u9088/u46EE/uB814/uDE5E/u0BDB" + "/uE032/u3A0A/u4906/u245C/uC2D3/uAC62/u9195/uE479" + "/uE7C8/u376D/u8DD5/u4EA9/u6C56/uF4EA/u657A/uAE08" + "/uBA78/u252E/u1CA6/uB4C6/uE8DD/u741F/u4BBD/u8B8A" + "/u703E/uB566/u4803/uF60E/u6135/u57B9/u86C1/u1D9E" + "/uE1F8/u9811/u69D9/u8E94/u9B1E/u87E9/uCE55/u28DF" + "/u8CA1/u890D/uBFE6/u4268/u4199/u2D0F/uB054/uBB16"; private static final byte[] Se= new byte[256]; private static final int[] Te0 = new int[256], Te1 = new int[256], Te2 = new int[256], Te3 = new int[256]; private static final byte[] Sd= new byte[256]; private static final int[] Td0 = new int[256], Td1 = new int[256], Td2 = new int[256], Td3 = new int[256]; /** * Round constants */ private static final int[] rcon = new int[10]; /** for 128-bit blocks,