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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? openpgpcfbblockcipher.java

?? 內(nèi)容:基于jdk1.4的加密算法的具體實現(xiàn)
?? JAVA
字號:
package org.bouncycastle.crypto.modes;import org.bouncycastle.crypto.BlockCipher;import org.bouncycastle.crypto.CipherParameters;import org.bouncycastle.crypto.DataLengthException;/** * Implements OpenPGP's rather strange version of Cipher-FeedBack (CFB) mode * on top of a simple cipher. This class assumes the IV has been prepended * to the data stream already, and just accomodates the reset after * (blockSize + 2) bytes have been read. * <p> * For further info see <a href="http://www.ietf.org/rfc/rfc2440.html">RFC 2440</a>. */public class OpenPGPCFBBlockCipher    implements BlockCipher{    private byte[] IV;    private byte[] FR;    private byte[] FRE;    private byte[] tmp;    private BlockCipher cipher;    private int count;    private int blockSize;    private boolean forEncryption;        /**     * Basic constructor.     *     * @param cipher the block cipher to be used as the basis of the     * feedback mode.     */    public OpenPGPCFBBlockCipher(        BlockCipher cipher)    {        this.cipher = cipher;        this.blockSize = cipher.getBlockSize();        this.IV = new byte[blockSize];        this.FR = new byte[blockSize];        this.FRE = new byte[blockSize];        this.tmp = new byte[blockSize];    }    /**     * return the underlying block cipher that we are wrapping.     *     * @return the underlying block cipher that we are wrapping.     */    public BlockCipher getUnderlyingCipher()    {        return cipher;    }        /**     * return the algorithm name and mode.     *     * @return the name of the underlying algorithm followed by "/PGPCFB"     * and the block size in bits.     */    public String getAlgorithmName()    {        return cipher.getAlgorithmName() + "/OpenPGPCFB";    }        /**     * return the block size we are operating at.     *     * @return the block size we are operating at (in bytes).     */    public int getBlockSize()    {        return cipher.getBlockSize();    }    /**     * Process one block of input from the array in and write it to     * the out array.     *     * @param in the array containing the input data.     * @param inOff offset into the in array the data starts at.     * @param out the array the output data will be copied into.     * @param outOff the offset into the out array the output will start at.     * @exception DataLengthException if there isn't enough data in in, or     * space in out.     * @exception IllegalStateException if the cipher isn't initialised.     * @return the number of bytes processed and produced.     */    public int processBlock(        byte[] in,        int inOff,        byte[] out,        int outOff)        throws DataLengthException, IllegalStateException    {        return (forEncryption) ? encryptBlock(in, inOff, out, outOff) : decryptBlock(in, inOff, out, outOff);    }        /**     * reset the chaining vector back to the IV and reset the underlying     * cipher.     */    public void reset()    {        count = 0;        for (int i = 0; i != FR.length; i++)        {            FR[i] = IV[i];        }        cipher.reset();    }    /**     * Initialise the cipher and, possibly, the initialisation vector (IV).     * If an IV isn't passed as part of the parameter, the IV will be all zeros.     * An IV which is too short is handled in FIPS compliant fashion.     *     * @param forEncryption if true the cipher is initialised for     *  encryption, if false for decryption.     * @param params the key and other data required by the cipher.     * @exception IllegalArgumentException if the params argument is     * inappropriate.     */    public void init(        boolean forEncryption,        CipherParameters params)        throws IllegalArgumentException    {        this.forEncryption = forEncryption;             reset();        cipher.init(true, params);    }        /**     * Encrypt one byte of data according to CFB mode.     * @param data the byte to encrypt     * @param where am i in the current block, determines when to resync the block     * @returns the encrypted byte     */    private byte encryptByte(byte data, int blockOff)    {        return (byte)(FRE[blockOff] ^ data);    }        /**     * Do the appropriate processing for CFB IV mode encryption.     *     * @param in the array containing the data to be encrypted.     * @param inOff offset into the in array the data starts at.     * @param out the array the encrypted data will be copied into.     * @param outOff the offset into the out array the output will start at.     * @exception DataLengthException if there isn't enough data in in, or     * space in out.     * @exception IllegalStateException if the cipher isn't initialised.     * @return the number of bytes processed and produced.     */    private int encryptBlock(        byte[] in,        int inOff,        byte[] out,        int outOff)        throws DataLengthException, IllegalStateException    {        if ((inOff + blockSize) > in.length)        {            throw new DataLengthException("input buffer too short");        }        if ((outOff + blockSize) > out.length)        {            throw new DataLengthException("output buffer too short");        }                if (count > blockSize)        {            FR[blockSize - 2] = out[outOff] = encryptByte(in[inOff], blockSize - 2);            FR[blockSize - 1] = out[outOff + 1] = encryptByte(in[inOff + 1], blockSize - 1);            cipher.processBlock(FR, 0, FRE, 0);            for (int n = 2; n < blockSize; n++)             {                out[outOff + n] = encryptByte(in[inOff + n], n - 2);            }                        System.arraycopy(out, outOff + 2, FR, 0, blockSize - 2);        }        else if (count == 0)        {            cipher.processBlock(FR, 0, FRE, 0);            for (int n = 0; n < blockSize; n++)             {                out[outOff + n] = encryptByte(in[inOff + n], n);            }                        System.arraycopy(out, outOff, FR, 0, blockSize);            count += blockSize;        }        else if (count == blockSize)        {            cipher.processBlock(FR, 0, FRE, 0);            out[outOff] = encryptByte(in[inOff], 0);            out[outOff + 1] = encryptByte(in[inOff + 1], 1);            //            // do reset            //            System.arraycopy(FR, 2, FR, 0, blockSize - 2);            System.arraycopy(out, outOff, FR, blockSize - 2, 2);            cipher.processBlock(FR, 0, FRE, 0);            for (int n = 2; n < blockSize; n++)             {                out[outOff + n] = encryptByte(in[inOff + n], n - 2);            }            System.arraycopy(out, outOff + 2, FR, 0, blockSize - 2);            count += blockSize;        }                return blockSize;    }    /**     * Do the appropriate processing for CFB IV mode decryption.     *     * @param in the array containing the data to be decrypted.     * @param inOff offset into the in array the data starts at.     * @param out the array the encrypted data will be copied into.     * @param outOff the offset into the out array the output will start at.     * @exception DataLengthException if there isn't enough data in in, or     * space in out.     * @exception IllegalStateException if the cipher isn't initialised.     * @return the number of bytes processed and produced.     */    private int decryptBlock(        byte[] in,        int inOff,        byte[] out,        int outOff)        throws DataLengthException, IllegalStateException    {        if ((inOff + blockSize) > in.length)        {            throw new DataLengthException("input buffer too short");        }        if ((outOff + blockSize) > out.length)        {            throw new DataLengthException("output buffer too short");        }                if (count > blockSize)        {            // copy in buffer so that this mode works if in and out are the same             System.arraycopy(in, inOff, tmp, 0, blockSize);            out[outOff + 0] = encryptByte(tmp[0], blockSize - 2);            out[outOff + 1] = encryptByte(tmp[1], blockSize - 1);            System.arraycopy(tmp, 0, FR, blockSize - 2, 2);            cipher.processBlock(FR, 0, FRE, 0);                        for (int n = 2; n < blockSize; n++)             {                out[outOff + n] = encryptByte(tmp[n], n - 2);            }                        System.arraycopy(tmp, 2, FR, 0, blockSize - 2);        }         else if (count == 0)        {            cipher.processBlock(FR, 0, FRE, 0);                        for (int n = 0; n < blockSize; n++)             {                FR[n] = in[inOff + n];                out[n] = encryptByte(in[inOff + n], n);            }                        count += blockSize;        }        else if (count == blockSize)        {            System.arraycopy(in, inOff, tmp, 0, blockSize);                        cipher.processBlock(FR, 0, FRE, 0);            out[outOff + 0] = encryptByte(tmp[0], 0);            out[outOff + 1] = encryptByte(tmp[1], 1);                        System.arraycopy(FR, 2, FR, 0, blockSize - 2);                        FR[blockSize - 2] = tmp[0];            FR[blockSize - 1] = tmp[1];            cipher.processBlock(FR, 0, FRE, 0);            for (int n = 2; n < blockSize; n++)             {                FR[n - 2] = in[inOff + n];                out[outOff + n] = encryptByte(in[inOff + n], n - 2);            }            count += blockSize;        }                return blockSize;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区在线电影| 97精品视频在线观看自产线路二| 国精产品一区一区三区mba视频| 99久久久国产精品| 久久五月婷婷丁香社区| 亚洲va欧美va天堂v国产综合| 国产91精品久久久久久久网曝门| 欧美一区永久视频免费观看| 国产精品国模大尺度视频| 卡一卡二国产精品| 在线不卡欧美精品一区二区三区| 亚洲欧洲成人自拍| 成人永久aaa| 久久综合国产精品| 麻豆精品久久久| 欧美军同video69gay| 亚洲精品美国一| 播五月开心婷婷综合| 国产清纯白嫩初高生在线观看91 | 91麻豆精品国产91| 亚洲免费成人av| 99re在线精品| 亚洲女同一区二区| 92精品国产成人观看免费| 中文字幕精品一区| av中文字幕一区| 国产精品久久久久毛片软件| 懂色av一区二区三区免费看| 久久久综合精品| 国产乱妇无码大片在线观看| 欧美精品一区二区三区一线天视频 | 不卡视频一二三四| 欧美激情在线看| jiyouzz国产精品久久| 国产午夜精品福利| 成人免费视频一区| 国产精品亲子伦对白| 成人aaaa免费全部观看| 国产精品久久久久久久久久久免费看| 久久99精品国产| 久久亚洲捆绑美女| 懂色av噜噜一区二区三区av| 中文字幕精品一区| 91精品办公室少妇高潮对白| 亚洲国产乱码最新视频 | 天天操天天色综合| 日韩欧美国产系列| 国产精品一区二区不卡| 中文字幕免费不卡| 欧洲日韩一区二区三区| 午夜精品福利久久久| 欧美一区二区三区日韩| 久久精品国内一区二区三区| 国产日本亚洲高清| 欧美在线一二三四区| 喷白浆一区二区| 国产日韩精品一区二区浪潮av | 亚洲一区二区三区中文字幕在线 | 一区二区三区国产| 欧美肥妇bbw| 国产精品中文有码| 一区二区欧美精品| 欧美肥胖老妇做爰| 丁香五精品蜜臀久久久久99网站 | 国产精品视频一二| 欧美亚洲国产一区二区三区 | 久久视频一区二区| 日本久久一区二区| 久草在线在线精品观看| 爽好久久久欧美精品| 久久久久久黄色| 欧美日韩在线三区| 成人一区在线看| 日韩av电影免费观看高清完整版| 日本一区免费视频| 欧美久久久久久久久| 美女视频黄免费的久久| 亚洲免费观看高清完整版在线观看 | 欧美无砖砖区免费| 色综合天天做天天爱| 91免费观看国产| aaa欧美日韩| av高清不卡在线| 日本久久电影网| 欧美色欧美亚洲另类二区| 欧美性xxxxxxxx| 欧美美女直播网站| 欧美一区二区视频免费观看| 日韩一本二本av| 欧美成人精品福利| 久久久午夜精品理论片中文字幕| 久久久午夜精品| 国产精品国产三级国产aⅴ中文| 亚洲人成人一区二区在线观看| 亚洲美女在线国产| 亚洲va欧美va国产va天堂影院| 亚洲午夜在线电影| 久久99蜜桃精品| 国产成人av一区二区| 99国产精品视频免费观看| 日本久久一区二区| 日韩一级黄色大片| 国产精品欧美久久久久一区二区| 亚洲女女做受ⅹxx高潮| 婷婷亚洲久悠悠色悠在线播放| 蜜乳av一区二区| 成人免费看黄yyy456| 欧美在线制服丝袜| 精品成人私密视频| 一区二区三区在线观看网站| 丝袜诱惑亚洲看片| 处破女av一区二区| 欧美日韩中字一区| 国产清纯白嫩初高生在线观看91| 亚洲精品伦理在线| 精品中文字幕一区二区小辣椒| 成人av中文字幕| 综合在线观看色| 日韩国产高清在线| 福利一区在线观看| 欧美日韩一区二区三区在线看| 久久综合九色综合欧美就去吻| 亚洲靠逼com| 国产在线不卡视频| 欧美在线观看视频一区二区 | 婷婷六月综合亚洲| 丁香激情综合国产| 日韩一级在线观看| 亚洲乱码日产精品bd| 国产精品一区二区三区99 | 日韩欧美激情一区| 一区二区三区中文字幕| 国产美女精品人人做人人爽| 欧美丝袜丝交足nylons| 亚洲国产激情av| 美国欧美日韩国产在线播放| 91小宝寻花一区二区三区| 精品捆绑美女sm三区| 一区二区三区成人| 成人动漫精品一区二区| 精品国产乱码久久久久久夜甘婷婷 | 欧美日本在线看| 国产精品国产三级国产普通话99| 免费国产亚洲视频| 欧美这里有精品| 亚洲天堂中文字幕| 国产激情视频一区二区在线观看| 制服丝袜一区二区三区| 国产精品18久久久| 欧美不卡一区二区三区四区| 三级影片在线观看欧美日韩一区二区| 色综合视频在线观看| 国产午夜精品一区二区三区嫩草 | 亚洲精品一线二线三线| 午夜精品久久久久久久久久久| 99久久婷婷国产精品综合| 久久久久国产一区二区三区四区| 免费成人在线视频观看| 欧美高清激情brazzers| 午夜精品福利久久久| 欧美日韩视频专区在线播放| 一区二区三区视频在线看| 99在线热播精品免费| 国产精品久久久久9999吃药| 国产精品一区免费在线观看| 精品国产一区二区在线观看| 麻豆成人久久精品二区三区小说| 欧美日韩精品是欧美日韩精品| 亚洲色图都市小说| 一本久久精品一区二区| 亚洲麻豆国产自偷在线| 91国偷自产一区二区三区观看| 亚洲私人影院在线观看| 97久久精品人人做人人爽50路| 国产精品盗摄一区二区三区| 成人av免费在线| 中文字幕一区av| 91精品办公室少妇高潮对白| 亚洲成人av在线电影| 91精品欧美久久久久久动漫 | 久久蜜桃香蕉精品一区二区三区| 国模冰冰炮一区二区| 亚洲国产精品国自产拍av| 成人18视频在线播放| 亚洲天堂a在线| 欧美亚洲综合另类| 日本麻豆一区二区三区视频| 日韩精品一区二| 丁香亚洲综合激情啪啪综合| 亚洲人成网站色在线观看| 欧美日韩亚州综合| 国内精品国产成人| 中文字幕第一区综合| 欧美亚洲动漫制服丝袜| 麻豆91在线播放| 国产精品美日韩| 欧美日韩精品专区| 国产suv精品一区二区6| 亚洲一区二区精品3399| 精品久久久久久久人人人人传媒 |