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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? rc532engine.java

?? 內(nèi)容:基于jdk1.4的加密算法的具體實(shí)現(xiàn)
?? JAVA
字號(hào):
package org.bouncycastle.crypto.engines;import org.bouncycastle.crypto.BlockCipher;import org.bouncycastle.crypto.CipherParameters;import org.bouncycastle.crypto.params.KeyParameter;import org.bouncycastle.crypto.params.RC5Parameters;/** * The specification for RC5 came from the <code>RC5 Encryption Algorithm</code> * publication in RSA CryptoBytes, Spring of 1995.  * <em>http://www.rsasecurity.com/rsalabs/cryptobytes</em>. * <p> * This implementation has a word size of 32 bits. * <p> * Implementation courtesy of Tito Pena. */public class RC532Engine    implements BlockCipher{    /*     * the number of rounds to perform     */    private int _noRounds;    /*     * the expanded key array of size 2*(rounds + 1)     */    private int _S[];    /*     * our "magic constants" for 32 32     *     * Pw = Odd((e-2) * 2^wordsize)     * Qw = Odd((o-2) * 2^wordsize)     *     * where e is the base of natural logarithms (2.718281828...)     * and o is the golden ratio (1.61803398...)     */    private static final int P32 = 0xb7e15163;    private static final int Q32 = 0x9e3779b9;    private boolean forEncryption;    /**     * Create an instance of the RC5 encryption algorithm     * and set some defaults     */    public RC532Engine()    {        _noRounds     = 12;         // the default        _S            = null;    }    public String getAlgorithmName()    {        return "RC5-32";    }    public int getBlockSize()    {        return 2 * 4;    }    /**     * initialise a RC5-32 cipher.     *     * @param forEncryption 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             forEncryption,        CipherParameters    params)    {        if (params instanceof RC5Parameters)        {            RC5Parameters       p = (RC5Parameters)params;            _noRounds     = p.getRounds();            setKey(p.getKey());        }        else if (params instanceof KeyParameter)        {            KeyParameter       p = (KeyParameter)params;            setKey(p.getKey());        }        else        {            throw new IllegalArgumentException("invalid parameter passed to RC532 init - " + params.getClass().getName());        }        this.forEncryption = forEncryption;    }    public int processBlock(        byte[]  in,        int     inOff,        byte[]  out,        int     outOff)    {        return (forEncryption) ? encryptBlock(in, inOff, out, outOff)                                     : decryptBlock(in, inOff, out, outOff);    }    public void reset()    {    }    /**     * Re-key the cipher.     * <p>     * @param  key  the key to be used     */    private void setKey(        byte[]      key)    {        //        // KEY EXPANSION:        //        // There are 3 phases to the key expansion.        //        // Phase 1:        //   Copy the secret key K[0...b-1] into an array L[0..c-1] of        //   c = ceil(b/u), where u = 32/8 in little-endian order.        //   In other words, we fill up L using u consecutive key bytes        //   of K. Any unfilled byte positions in L are zeroed. In the        //   case that b = c = 0, set c = 1 and L[0] = 0.        //        int[]   L = new int[(key.length + (4 - 1)) / 4];        for (int i = 0; i != key.length; i++)        {            L[i / 4] += (key[i] & 0xff) << (8 * (i % 4));        }        //        // Phase 2:        //   Initialize S to a particular fixed pseudo-random bit pattern        //   using an arithmetic progression modulo 2^wordsize determined        //   by the magic numbers, Pw & Qw.        //        _S            = new int[2*(_noRounds + 1)];        _S[0] = P32;        for (int i=1; i < _S.length; i++)        {            _S[i] = (_S[i-1] + Q32);        }        //        // Phase 3:        //   Mix in the user's secret key in 3 passes over the arrays S & L.        //   The max of the arrays sizes is used as the loop control        //        int iter;        if (L.length > _S.length)        {            iter = 3 * L.length;        }        else        {            iter = 3 * _S.length;        }        int A = 0, B = 0;        int i = 0, j = 0;        for (int k = 0; k < iter; k++)        {            A = _S[i] = rotateLeft(_S[i] + A + B, 3);            B =  L[j] = rotateLeft(L[j] + A + B, A+B);            i = (i+1) % _S.length;            j = (j+1) %  L.length;        }    }    /**     * Encrypt the given block starting at the given offset and place     * the result in the provided buffer starting at the given offset.     * <p>     * @param  in     in byte buffer containing data to encrypt     * @param  inOff  offset into src buffer     * @param  out     out buffer where encrypted data is written     * @param  outOff  offset into out buffer     */    private int encryptBlock(        byte[]  in,        int     inOff,        byte[]  out,        int     outOff)    {        int A = bytesToWord(in, inOff) + _S[0];        int B = bytesToWord(in, inOff + 4) + _S[1];        for (int i = 1; i <= _noRounds; i++)        {            A = rotateLeft(A ^ B, B) + _S[2*i];            B = rotateLeft(B ^ A, A) + _S[2*i+1];        }                wordToBytes(A, out, outOff);        wordToBytes(B, out, outOff + 4);                return 2 * 4;    }    private int decryptBlock(        byte[]  in,        int     inOff,        byte[]  out,        int     outOff)    {        int A = bytesToWord(in, inOff);        int B = bytesToWord(in, inOff + 4);        for (int i = _noRounds; i >= 1; i--)        {            B = rotateRight(B - _S[2*i+1], A) ^ A;            A = rotateRight(A - _S[2*i],   B) ^ B;        }                wordToBytes(A - _S[0], out, outOff);        wordToBytes(B - _S[1], out, outOff + 4);                return 2 * 4;    }        //////////////////////////////////////////////////////////////    //    // PRIVATE Helper Methods    //    //////////////////////////////////////////////////////////////    /**     * Perform a left "spin" of the word. The rotation of the given     * word <em>x</em> is rotated left by <em>y</em> bits.     * Only the <em>lg(32)</em> low-order bits of <em>y</em>     * are used to determine the rotation amount. Here it is      * assumed that the wordsize used is a power of 2.     * <p>     * @param  x  word to rotate     * @param  y    number of bits to rotate % 32     */    private int rotateLeft(int x, int y)    {        return ((x << (y & (32-1))) | (x >>> (32 - (y & (32-1)))));    }    /**     * Perform a right "spin" of the word. The rotation of the given     * word <em>x</em> is rotated left by <em>y</em> bits.     * Only the <em>lg(32)</em> low-order bits of <em>y</em>     * are used to determine the rotation amount. Here it is      * assumed that the wordsize used is a power of 2.     * <p>     * @param  x  word to rotate     * @param  y    number of bits to rotate % 32     */    private int rotateRight(int x, int y)    {        return ((x >>> (y & (32-1))) | (x << (32 - (y & (32-1)))));    }    private int bytesToWord(        byte[]  src,        int     srcOff)    {        return (src[srcOff] & 0xff) | ((src[srcOff + 1] & 0xff) << 8)            | ((src[srcOff + 2] & 0xff) << 16) | ((src[srcOff + 3] & 0xff) << 24);    }    private void wordToBytes(        int    word,        byte[]  dst,        int     dstOff)    {        dst[dstOff] = (byte)word;        dst[dstOff + 1] = (byte)(word >> 8);        dst[dstOff + 2] = (byte)(word >> 16);        dst[dstOff + 3] = (byte)(word >> 24);    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品乱码久久久久久| 久久99国产精品麻豆| 精品免费国产一区二区三区四区| 91国产免费看| 在线观看区一区二| 欧美日韩日日夜夜| 欧美日韩国产a| 欧美一区二区在线不卡| 日韩一区二区三区三四区视频在线观看 | 久久人人97超碰com| 欧美成人女星排名| 一卡二卡三卡日韩欧美| 五月天国产精品| 极品少妇一区二区| 欧美三级日韩在线| 亚洲伦在线观看| 亚洲天堂精品视频| 亚洲一区二区偷拍精品| 青青草原综合久久大伊人精品优势| 久久丁香综合五月国产三级网站 | 亚洲免费av高清| 国产成人综合自拍| 色成年激情久久综合| 中文字幕+乱码+中文字幕一区| 最新中文字幕一区二区三区| 亚洲一区二区在线播放相泽| eeuss鲁片一区二区三区| 制服丝袜av成人在线看| 久久久亚洲高清| 韩国欧美一区二区| 色嗨嗨av一区二区三区| 日韩一区日韩二区| 成人激情黄色小说| 日韩一区二区麻豆国产| 丝袜亚洲另类欧美| 成人动漫一区二区| 国产精品国产自产拍高清av王其| 亚洲高清视频中文字幕| 成人av资源在线| 中文字幕一区日韩精品欧美| voyeur盗摄精品| 中文字幕在线免费不卡| 一本大道久久a久久精二百| 久久久综合九色合综国产精品| 精品一二三四区| 欧美国产亚洲另类动漫| 北条麻妃一区二区三区| 亚洲男同1069视频| 欧美日韩日日骚| 日本视频免费一区| 在线免费观看日本欧美| 亚洲成人三级小说| 91麻豆免费视频| 国产日韩在线不卡| 国产综合色精品一区二区三区| 精品国产区一区| 久久精品久久综合| 中文字幕乱码一区二区免费| 一本色道亚洲精品aⅴ| 亚洲影院理伦片| 日韩精品一区二区三区视频在线观看 | 国产精品私房写真福利视频| 成人97人人超碰人人99| 亚洲一区二区三区在线播放| 91精品国产品国语在线不卡 | 午夜精品在线看| 久久伊99综合婷婷久久伊| 奇米影视在线99精品| 久久精品亚洲乱码伦伦中文| 狠狠色狠狠色综合日日91app| 国产欧美久久久精品影院| www.欧美亚洲| 免费高清在线视频一区·| 国产精品久久久久久亚洲毛片 | 狠狠色丁香久久婷婷综合_中| 国产精品激情偷乱一区二区∴| 欧美日韩高清一区二区| 黑人精品欧美一区二区蜜桃| 亚洲日本电影在线| 欧美大胆一级视频| 97精品视频在线观看自产线路二| 国产精品全国免费观看高清 | 91香蕉视频在线| 日本中文在线一区| 亚洲精品欧美综合四区| 欧美变态tickling挠脚心| 色视频一区二区| 成人黄色777网| 久久国内精品视频| 性久久久久久久| 国产农村妇女毛片精品久久麻豆 | 热久久免费视频| 18涩涩午夜精品.www| 精品国产一区二区三区久久影院| 日本高清不卡视频| 不卡av在线网| 久久99最新地址| 蜜桃久久久久久久| 久久精品日韩一区二区三区| 欧美丰满美乳xxx高潮www| 精品一区二区在线播放| 天天操天天色综合| 亚洲免费观看高清完整| 国产精品久久夜| 欧美国产视频在线| 26uuu亚洲婷婷狠狠天堂| 日韩欧美一区在线| 91精品一区二区三区在线观看| 欧美怡红院视频| 精品综合免费视频观看| 午夜在线电影亚洲一区| 亚洲乱码国产乱码精品精98午夜| 久久精品欧美日韩| 久久九九99视频| 久久久国产午夜精品| 精品国精品国产| 久久综合久久99| 欧美tk—视频vk| 精品日韩99亚洲| 久久久精品综合| 久久久久亚洲蜜桃| 国产蜜臀97一区二区三区| 久久久久久免费| 国产精品沙发午睡系列990531| 欧美高清一级片在线观看| 一区在线观看视频| 中文字幕日韩欧美一区二区三区| 最新欧美精品一区二区三区| 亚洲欧美日韩小说| 亚洲一区二区三区视频在线播放| 亚洲摸摸操操av| 亚洲一区二区高清| 美腿丝袜亚洲三区| 国产成人午夜99999| 白白色亚洲国产精品| 色婷婷综合久久久| 欧美一区二区视频在线观看2020| 欧美老人xxxx18| 久久久久久电影| 亚洲色图视频网站| 午夜精品成人在线视频| 久久99热狠狠色一区二区| 国产1区2区3区精品美女| 久久国产精品99精品国产| 国产乱一区二区| 久久精品国产成人一区二区三区| 国产在线播放一区| 看电视剧不卡顿的网站| 成人自拍视频在线观看| 国产真实乱子伦精品视频| 26uuu精品一区二区| 精品国产免费一区二区三区四区| 国产精品人人做人人爽人人添 | 日韩综合小视频| 国产一区二三区好的| av电影一区二区| 91精品国产手机| 亚洲视频狠狠干| 美女精品自拍一二三四| 色老头久久综合| 久久久久久久电影| 亚洲国产一区二区在线播放| 国内成+人亚洲+欧美+综合在线| 91麻豆自制传媒国产之光| 日韩精品一区二区三区视频在线观看 | 天天亚洲美女在线视频| 高清在线观看日韩| 7777精品伊人久久久大香线蕉 | 国产片一区二区三区| 午夜视频一区二区三区| 成人av综合一区| 欧美精品一区二区三区在线播放| 亚洲色图制服丝袜| 丁香一区二区三区| 欧美不卡123| 日韩国产高清在线| 一本色道**综合亚洲精品蜜桃冫| 亚洲精品一区二区三区蜜桃下载| 亚洲国产精品久久久久秋霞影院 | 国产一区二区三区四区在线观看| 欧美三级欧美一级| 亚洲欧洲成人精品av97| 国产大陆精品国产| 久久亚洲一区二区三区明星换脸| 亚洲成人综合视频| 色狠狠桃花综合| 亚洲人成网站在线| 国产91高潮流白浆在线麻豆| 日韩视频一区二区三区在线播放| 亚洲综合在线电影| 色综合久久综合网欧美综合网| 久久久高清一区二区三区| 精久久久久久久久久久| 欧美成人高清电影在线| 日本在线不卡视频一二三区| 欧美人狂配大交3d怪物一区| 亚洲二区在线观看| 欧美亚洲动漫另类| 亚洲一二三区视频在线观看| 欧洲激情一区二区|