亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? blowfishengine.java

?? 內容:基于jdk1.4的加密算法的具體實現
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,                0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6            };    //====================================    // Useful constants    //====================================    private static final int    ROUNDS = 16;    private static final int    BLOCK_SIZE = 8;  // bytes = 64 bits    private static final int    SBOX_SK = 256;    private static final int    P_SZ = ROUNDS+2;    private final int[] S0, S1, S2, S3;     // the s-boxes    private final int[] P;                  // the p-array    private boolean encrypting = false;    private byte[] workingKey = null;    public BlowfishEngine()    {        S0 = new int[SBOX_SK];        S1 = new int[SBOX_SK];        S2 = new int[SBOX_SK];        S3 = new int[SBOX_SK];        P = new int[P_SZ];    }    /**     * initialise a Blowfish cipher.     *     * @param encrypting whether or not we are for encryption.     * @param params the parameters required to set up the cipher.     * @exception IllegalArgumentException if the params argument is     * inappropriate.     */    public void init(        boolean             encrypting,        CipherParameters    params)    {        if (params instanceof KeyParameter)        {            this.encrypting = encrypting;            this.workingKey = ((KeyParameter)params).getKey();            setKey(this.workingKey);            return;        }        throw new IllegalArgumentException("invalid parameter passed to Blowfish init - " + params.getClass().getName());    }    public String getAlgorithmName()    {        return "Blowfish";    }    public final int processBlock(        byte[] in,        int inOff,        byte[] out,        int outOff)    {        if (workingKey == null)        {            throw new IllegalStateException("Blowfish not initialised");        }        if ((inOff + BLOCK_SIZE) > in.length)        {            throw new DataLengthException("input buffer too short");        }        if ((outOff + BLOCK_SIZE) > out.length)        {            throw new DataLengthException("output buffer too short");        }        if (encrypting)        {            encryptBlock(in, inOff, out, outOff);        }        else        {                decryptBlock(in, inOff, out, outOff);        }        return BLOCK_SIZE;    }    public void reset()    {    }    public int getBlockSize()    {        return BLOCK_SIZE;    }    //==================================    // Private Implementation    //==================================    private int F(int x)    {        return (((S0[(x >>> 24)] + S1[(x >>> 16) & 0xff])                            ^ S2[(x >>> 8) & 0xff]) + S3[x & 0xff]);    }    /**     * apply the encryption cycle to each value pair in the table.     */    private void processTable(        int     xl,        int     xr,        int[]   table)    {        int size = table.length;        for (int s = 0; s < size; s += 2)        {            xl ^= P[0];            for (int i = 1; i < ROUNDS; i += 2)            {                xr ^= F(xl) ^ P[i];                xl ^= F(xr) ^ P[i + 1];            }            xr ^= P[ROUNDS + 1];            table[s] = xr;            table[s + 1] = xl;            xr = xl;            // end of cycle swap            xl = table[s];        }    }    private void setKey(byte[] key)    {        /*         * - comments are from _Applied Crypto_, Schneier, p338         * please be careful comparing the two, AC numbers the         * arrays from 1, the enclosed code from 0.         *         * (1)         * Initialise the S-boxes and the P-array, with a fixed string         * This string contains the hexadecimal digits of pi (3.141...)         */        System.arraycopy(KS0, 0, S0, 0, SBOX_SK);        System.arraycopy(KS1, 0, S1, 0, SBOX_SK);        System.arraycopy(KS2, 0, S2, 0, SBOX_SK);        System.arraycopy(KS3, 0, S3, 0, SBOX_SK);        System.arraycopy(KP, 0, P, 0, P_SZ);        /*         * (2)         * Now, XOR P[0] with the first 32 bits of the key, XOR P[1] with the         * second 32-bits of the key, and so on for all bits of the key         * (up to P[17]).  Repeatedly cycle through the key bits until the         * entire P-array has been XOR-ed with the key bits         */        int keyLength = key.length;        int keyIndex = 0;        for (int i=0; i < P_SZ; i++)        {            // get the 32 bits of the key, in 4 * 8 bit chunks            int data = 0x0000000;            for (int j=0; j < 4; j++)            {                // create a 32 bit block                data = (data << 8) | (key[keyIndex++] & 0xff);                // wrap when we get to the end of the key                if (keyIndex >= keyLength)                {                    keyIndex = 0;                }            }            // XOR the newly created 32 bit chunk onto the P-array            P[i] ^= data;        }        /*         * (3)         * Encrypt the all-zero string with the Blowfish algorithm, using         * the subkeys described in (1) and (2)         *         * (4)         * Replace P1 and P2 with the output of step (3)         *         * (5)         * Encrypt the output of step(3) using the Blowfish algorithm,         * with the modified subkeys.         *         * (6)         * Replace P3 and P4 with the output of step (5)         *         * (7)         * Continue the process, replacing all elements of the P-array         * and then all four S-boxes in order, with the output of the         * continuously changing Blowfish algorithm         */        processTable(0, 0, P);        processTable(P[P_SZ - 2], P[P_SZ - 1], S0);        processTable(S0[SBOX_SK - 2], S0[SBOX_SK - 1], S1);        processTable(S1[SBOX_SK - 2], S1[SBOX_SK - 1], S2);        processTable(S2[SBOX_SK - 2], S2[SBOX_SK - 1], S3);    }    /**     * Encrypt the given input starting at the given offset and place     * the result in the provided buffer starting at the given offset.     * The input will be an exact multiple of our blocksize.     */    private void encryptBlock(        byte[]  src,        int     srcIndex,        byte[]  dst,        int     dstIndex)    {        int xl = BytesTo32bits(src, srcIndex);        int xr = BytesTo32bits(src, srcIndex+4);        xl ^= P[0];        for (int i = 1; i < ROUNDS; i += 2)        {            xr ^= F(xl) ^ P[i];            xl ^= F(xr) ^ P[i + 1];        }        xr ^= P[ROUNDS + 1];        Bits32ToBytes(xr, dst, dstIndex);        Bits32ToBytes(xl, dst, dstIndex + 4);    }    /**     * Decrypt the given input starting at the given offset and place     * the result in the provided buffer starting at the given offset.     * The input will be an exact multiple of our blocksize.     */    private void decryptBlock(        byte[] src,         int srcIndex,        byte[] dst,        int dstIndex)    {        int xl = BytesTo32bits(src, srcIndex);        int xr = BytesTo32bits(src, srcIndex + 4);        xl ^= P[ROUNDS + 1];        for (int i = ROUNDS; i > 0 ; i -= 2)        {            xr ^= F(xl) ^ P[i];            xl ^= F(xr) ^ P[i - 1];        }        xr ^= P[0];        Bits32ToBytes(xr, dst, dstIndex);        Bits32ToBytes(xl, dst, dstIndex+4);    }    private int BytesTo32bits(byte[] b, int i)    {        return ((b[i]   & 0xff) << 24) |              ((b[i+1] & 0xff) << 16) |             ((b[i+2] & 0xff) << 8) |             ((b[i+3] & 0xff));    }    private void Bits32ToBytes(int in,  byte[] b, int offset)    {        b[offset + 3] = (byte)in;        b[offset + 2] = (byte)(in >> 8);        b[offset + 1] = (byte)(in >> 16);        b[offset]     = (byte)(in >> 24);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精彩视频一区二区| 日本韩国一区二区三区视频| 亚洲一区二区三区在线播放| 中文字幕欧美一| 亚洲欧美日韩国产综合在线| 亚洲国产精品麻豆| 久久成人av少妇免费| 国产91精品久久久久久久网曝门 | 欧美图区在线视频| 欧美一区午夜视频在线观看| 国产午夜精品福利| 亚洲欧美一区二区三区国产精品 | 国产自产高清不卡| 欧美三片在线视频观看| 久久久亚洲午夜电影| 亚洲成a人v欧美综合天堂| 国产乱人伦偷精品视频免下载| 99综合影院在线| 久久精品无码一区二区三区| 日本人妖一区二区| 91蜜桃传媒精品久久久一区二区| 久久综合久久99| 美女网站色91| 91精品麻豆日日躁夜夜躁| 中文字幕一区日韩精品欧美| 国产传媒久久文化传媒| 欧美v国产在线一区二区三区| 亚洲一区中文日韩| 欧美午夜精品久久久久久孕妇| 久久久99精品久久| 欧美色倩网站大全免费| 中文字幕av资源一区| 国产精品一二三| 国产精品理伦片| 一本一道波多野结衣一区二区| 国产亚洲欧美一区在线观看| 高清在线观看日韩| 一区二区三区在线影院| 7777女厕盗摄久久久| 裸体一区二区三区| 欧美极品另类videosde| 一本到一区二区三区| 日韩av网站免费在线| 欧美v亚洲v综合ⅴ国产v| 高清在线观看日韩| 日韩精品电影在线观看| 中文字幕国产一区| 在线综合视频播放| 91丨porny丨户外露出| 久久成人18免费观看| 中文字幕一区二区三区在线观看| 欧美色国产精品| 波多野结衣亚洲| 久久99精品久久久久久国产越南| 国产精品丝袜91| 日韩免费视频一区| 欧美高清视频一二三区 | 在线精品视频免费播放| 精品影院一区二区久久久| 中文字幕一区三区| 国产清纯白嫩初高生在线观看91| 欧美中文字幕一区| 欧美在线影院一区二区| 成人动漫精品一区二区| 国产精品一区二区黑丝| 日韩激情视频网站| 久久99久久精品欧美| 麻豆国产精品777777在线| 亚洲成人中文在线| 日本伊人精品一区二区三区观看方式| 亚洲少妇屁股交4| 国产精品狼人久久影院观看方式| 日韩欧美一区二区免费| 欧美一级高清片在线观看| 日韩一区二区精品在线观看| 日韩免费视频线观看| 国产亚洲va综合人人澡精品| 国产精品色哟哟网站| 日韩码欧中文字| 亚洲va天堂va国产va久| 精品在线播放午夜| 色综合久久99| 久久麻豆一区二区| 一区二区三区在线播| 亚洲国产aⅴ天堂久久| 国产一区二区三区在线观看免费| 国产乱子伦视频一区二区三区 | 香蕉久久夜色精品国产使用方法| 日本aⅴ精品一区二区三区| 国产jizzjizz一区二区| 欧美日韩国产色站一区二区三区| 精品美女一区二区三区| 国产精品久线在线观看| 免费精品视频在线| 欧美日韩一区二区三区视频| 26uuu另类欧美亚洲曰本| 午夜精品视频在线观看| 国产酒店精品激情| 日韩精品中文字幕一区二区三区| 夜夜精品视频一区二区| 国产精品亚洲一区二区三区在线| 欧美视频一区二区三区四区| 国产精品对白交换视频| 成人综合在线视频| 欧美高清在线视频| 国产成人午夜视频| 国产精品免费视频一区| 国产精品中文有码| 国产精品乱码人人做人人爱 | 欧美午夜精品理论片a级按摩| 国产精品美女一区二区| 91亚洲永久精品| 尤物av一区二区| 91精品国产一区二区三区蜜臀| 亚洲无线码一区二区三区| 蜜桃视频一区二区三区在线观看| 欧美巨大另类极品videosbest | 亚洲丝袜精品丝袜在线| 在线免费观看日本欧美| 亚洲国产综合在线| 91精品国产综合久久香蕉的特点| 九色|91porny| 国产精品理论片| 日韩一区二区在线观看视频| 国产精品亚洲视频| 亚洲国产成人va在线观看天堂| 欧美久久久久久蜜桃| 久久精品999| 午夜精品123| 18欧美乱大交hd1984| 欧美tickling网站挠脚心| 91丨九色丨国产丨porny| 久久精品国产第一区二区三区| 欧美国产日韩a欧美在线观看 | 美女精品自拍一二三四| 一区二区三区不卡视频在线观看| 在线播放欧美女士性生活| 972aa.com艺术欧美| 国产成都精品91一区二区三| 日韩精品一级二级| 亚洲一级二级三级| 樱桃视频在线观看一区| 亚洲人xxxx| 夜夜爽夜夜爽精品视频| 亚洲男人的天堂一区二区 | 国产·精品毛片| 成人精品高清在线| 成人高清视频在线观看| 粉嫩av亚洲一区二区图片| 成人久久18免费网站麻豆| 99久久国产综合色|国产精品| 成人丝袜18视频在线观看| 99久久精品免费看国产免费软件| 国产精品一区二区在线观看网站| 国产精品主播直播| 色播五月激情综合网| 欧美日韩一区 二区 三区 久久精品| 色婷婷国产精品久久包臀| 在线视频一区二区免费| 欧美一区二区三区啪啪| 国产午夜亚洲精品羞羞网站| 国产精品天干天干在观线| 亚洲成av人片在线观看无码| 理论片日本一区| 在线观看日韩电影| 久久亚洲春色中文字幕久久久| 国产日韩欧美综合一区| 亚洲成人动漫av| 一本色道**综合亚洲精品蜜桃冫| 91精品欧美一区二区三区综合在| 国产网站一区二区| 久草这里只有精品视频| 欧美日韩国产精品自在自线| 国产亚洲精品福利| 精品一区二区三区久久| 精品视频1区2区3区| 国产精品网站在线播放| 老司机一区二区| 日韩免费看网站| 麻豆国产精品官网| 欧美大片免费久久精品三p| 亚洲已满18点击进入久久| 99r国产精品| 亚洲精品国产一区二区三区四区在线| 国产精品18久久久| 久久精品日产第一区二区三区高清版| 奇米888四色在线精品| 欧美日韩不卡在线| 美女在线视频一区| 久久尤物电影视频在线观看| 精品无人码麻豆乱码1区2区 | 亚洲成人精品一区二区| 色www精品视频在线观看| 一区二区欧美在线观看| 精品视频全国免费看| 免播放器亚洲一区| 国产女人aaa级久久久级| 色综合久久综合中文综合网| 亚洲国产一区二区视频| 91精品在线麻豆|