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

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

?? pgpcfbblockcipher.java

?? 內(nèi)容:基于jdk1.4的加密算法的具體實(shí)現(xiàn)
?? JAVA
字號(hào):
package org.bouncycastle.crypto.modes;import org.bouncycastle.crypto.BlockCipher;import org.bouncycastle.crypto.CipherParameters;import org.bouncycastle.crypto.DataLengthException;import org.bouncycastle.crypto.params.ParametersWithIV;/** * Implements OpenPGP's rather strange version of Cipher-FeedBack (CFB) mode on top of a simple cipher. For further info see <a href="http://www.ietf.org/rfc/rfc2440.html">RFC 2440</a>. */public class PGPCFBBlockCipher    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;        private boolean inlineIv; // if false we don't need to prepend an IV    /**     * Basic constructor.     *     * @param cipher the block cipher to be used as the basis of the     * feedback mode.     * @param inlineIv if true this is for PGP CFB with a prepended iv.     */    public PGPCFBBlockCipher(        BlockCipher cipher,        boolean     inlineIv)    {        this.cipher = cipher;        this.inlineIv = inlineIv;        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()    {        if (inlineIv)        {            return cipher.getAlgorithmName() + "/PGPCFBwithIV";        }        else        {            return cipher.getAlgorithmName() + "/PGPCFB";        }    }        /**     * 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    {        if (inlineIv)        {            return (forEncryption) ? encryptBlockWithIV(in, inOff, out, outOff) : decryptBlockWithIV(in, inOff, out, outOff);        }        else        {            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++)        {            if (inlineIv)            {                FR[i] = 0;            }            else            {                FR[i] = IV[i]; // if simple mode, key is IV (even if this is zero)            }        }        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;             if (params instanceof ParametersWithIV)        {                ParametersWithIV ivParam = (ParametersWithIV)params;                byte[]      iv = ivParam.getIV();                if (iv.length < IV.length)                {                    // prepend the supplied IV with zeros (per FIPS PUB 81)                    System.arraycopy(iv, 0, IV, IV.length - iv.length, iv.length);                    for (int i = 0; i < IV.length - iv.length; i++)                    {                            IV[i] = 0;                    }                }                else                {                    System.arraycopy(iv, 0, IV, 0, IV.length);                }                reset();                cipher.init(true, ivParam.getParameters());        }        else        {                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 encryptBlockWithIV(        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 == 0)        {            cipher.processBlock(FR, 0, FRE, 0);            for (int n = 0; n < blockSize; n++)             {                out[outOff + n] = encryptByte(IV[n], n);            }                        System.arraycopy(out, outOff, FR, 0, blockSize);            cipher.processBlock(FR, 0, FRE, 0);            out[outOff + blockSize] = encryptByte(IV[blockSize - 2], 0);            out[outOff + blockSize + 1] = encryptByte(IV[blockSize - 1], 1);            System.arraycopy(out, outOff + 2, FR, 0, blockSize);                        cipher.processBlock(FR, 0, FRE, 0);            for (int n = 0; n < blockSize; n++)             {                out[outOff + blockSize + 2 + n] = encryptByte(in[inOff + n], n);            }            System.arraycopy(out, outOff + blockSize + 2, FR, 0, blockSize);            count += 2 * blockSize + 2;            return 2 * blockSize + 2;        }        else if (count >= blockSize + 2)        {            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);        }                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 decryptBlockWithIV(        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 == 0)        {            for (int n = 0; n < blockSize; n++)             {                FR[n] = in[inOff + n];            }                        cipher.processBlock(FR, 0, FRE, 0);            count += blockSize;            return 0;        }        else 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);                    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 = 0; n < blockSize - 2; n++)             {                out[outOff + n] = encryptByte(tmp[n + 2], n);            }            System.arraycopy(tmp, 2, FR, 0, blockSize - 2);            count += 2;            return blockSize - 2;        }        else if (count >= blockSize + 2)        {            // 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 = 0; n < blockSize - 2; n++)             {                out[outOff + n + 2] = encryptByte(tmp[n + 2], n);            }                        System.arraycopy(tmp, 2, FR, 0, blockSize - 2);                    }                 return blockSize;    }        /**     * Do the appropriate processing for CFB 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");        }                cipher.processBlock(FR, 0, FRE, 0);        for (int n = 0; n < blockSize; n++)         {            out[outOff + n] = encryptByte(in[inOff + n], n);        }                for (int n = 0; n < blockSize; n++)         {            FR[n] = out[outOff + n];        }                return blockSize;            }        /**     * Do the appropriate processing for CFB 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");        }                cipher.processBlock(FR, 0, FRE, 0);        for (int n = 0; n < blockSize; n++)         {            out[outOff + n] = encryptByte(in[inOff + n], n);        }                for (int n = 0; n < blockSize; n++)         {            FR[n] = in[inOff + n];        }                return blockSize;            }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美综合在线视频| 欧美网站一区二区| 国产精品久久久一本精品| 欧美zozozo| 99久久婷婷国产综合精品 | 7777女厕盗摄久久久| 国产毛片精品一区| 丝袜国产日韩另类美女| 亚洲色图制服诱惑| 国产女人aaa级久久久级| 欧美日韩卡一卡二| 国产福利一区二区三区视频| 三级成人在线视频| 一区二区三区中文字幕精品精品 | 一本到三区不卡视频| 国产一区二区按摩在线观看| 日本一区中文字幕| 亚洲成人免费在线| 一区二区三区成人在线视频| 国产精品无码永久免费888| 精品入口麻豆88视频| 欧美久久一区二区| 欧美亚洲尤物久久| 91免费视频大全| 不卡高清视频专区| 国产成人免费视频| 国产成人综合在线| 国产精品一区二区黑丝| 久久成人免费网站| 美女视频一区二区| 午夜精品久久久久久久久久| 一区二区三区蜜桃网| 亚洲你懂的在线视频| 综合电影一区二区三区| 中文字幕一区在线| 中文欧美字幕免费| 日本一区二区视频在线| 久久久精品免费网站| 国产亚洲女人久久久久毛片| 精品国产sm最大网站免费看| 精品国产不卡一区二区三区| 2020国产精品| 国产欧美精品国产国产专区 | 亚洲精品国产a| 国产精品美女久久久久av爽李琼| 久久久九九九九| 国产精品无人区| 亚洲欧洲成人精品av97| 国产精品国产三级国产a| 成人免费小视频| 亚洲一区二区三区中文字幕| 午夜精品久久久久久久久| 麻豆专区一区二区三区四区五区| 黄色精品一二区| 国产成人99久久亚洲综合精品| 不卡一区在线观看| 欧美午夜精品一区二区三区| 3atv在线一区二区三区| 精品国产乱码久久久久久久 | 91黄色小视频| 欧美一区二区三区视频免费播放 | 欧美撒尿777hd撒尿| 欧美精品成人一区二区三区四区| 日韩欧美高清一区| 久久精品在线观看| 亚洲欧美日韩系列| 午夜精品久久久久久久蜜桃app| 久久精品国产亚洲高清剧情介绍 | 欧美美女直播网站| 精品国产91亚洲一区二区三区婷婷| 久久久精品日韩欧美| 国产精品久久久久久久浪潮网站| 亚洲最大成人网4388xx| 日本vs亚洲vs韩国一区三区二区| 国产精品综合二区| 欧美午夜影院一区| 欧美精品一区二区三区蜜臀 | 亚洲一区自拍偷拍| 美日韩一区二区三区| 成人小视频免费在线观看| 欧美日韩一区三区四区| 久久婷婷国产综合精品青草| 日韩在线a电影| 成人免费精品视频| 欧美一区二区三区啪啪| 国产精品免费丝袜| 日日夜夜免费精品| av午夜一区麻豆| 欧美老肥妇做.爰bbww视频| 国产三级精品视频| 五月天国产精品| 99久久精品国产毛片| 精品美女在线播放| 亚洲国产一区二区a毛片| 国产黄色成人av| 欧美一区三区四区| 依依成人综合视频| 国产91清纯白嫩初高中在线观看| 欧美日韩在线亚洲一区蜜芽| 国产片一区二区三区| 日韩成人免费看| 在线观看91视频| 国产精品天干天干在观线| 美女视频黄免费的久久| 欧美综合天天夜夜久久| 国产精品丝袜91| 狠狠色丁香婷综合久久| 欧美精品免费视频| 亚洲精品免费在线观看| 国产福利不卡视频| 精品国产一区二区三区久久影院| 亚洲国产成人91porn| av不卡一区二区三区| 久久久精品日韩欧美| 精品一区免费av| 欧美日韩精品高清| 亚洲一二三四区| 91免费在线看| 日韩美女啊v在线免费观看| 国产精品一区二区久久精品爱涩| 欧美一区二区免费视频| 视频一区二区三区中文字幕| 欧美在线你懂得| 亚洲欧美日韩在线不卡| av日韩在线网站| 亚洲国产成人自拍| 国产mv日韩mv欧美| 国产亚洲午夜高清国产拍精品| 免费成人性网站| 欧美一卡二卡在线| 日韩极品在线观看| 欧美精品乱人伦久久久久久| 午夜日韩在线电影| 欧美男女性生活在线直播观看| 国产精品综合网| 国产亚洲精品精华液| 国产aⅴ精品一区二区三区色成熟| 精品处破学生在线二十三| 久久爱另类一区二区小说| 精品久久久久久久人人人人传媒| 乱一区二区av| 久久午夜羞羞影院免费观看| 国产激情精品久久久第一区二区 | 99久久精品国产网站| 国产精品国产三级国产aⅴ无密码| 成人国产精品免费网站| 亚洲欧美日韩一区| 欧美日韩免费一区二区三区 | 狠狠狠色丁香婷婷综合久久五月| 精品国产人成亚洲区| 国v精品久久久网| 亚洲欧美日韩系列| 欧美视频一区二| 免费观看30秒视频久久| 久久久九九九九| 99精品黄色片免费大全| 亚洲午夜精品17c| 日韩欧美三级在线| 国产91露脸合集magnet | 国产精品网曝门| 99riav久久精品riav| 亚洲一区二区美女| 日韩一区和二区| 国产成人在线免费| 一区二区成人在线视频| 欧美一区二区三区喷汁尤物| 国产剧情一区在线| 亚洲三级在线播放| 日韩一区二区影院| 成人av一区二区三区| 午夜精品福利久久久| 久久噜噜亚洲综合| 91国产免费看| 久久99热这里只有精品| 亚洲视频精选在线| 这里只有精品免费| www.色精品| 日本不卡一区二区| 国产精品素人一区二区| 欧美日韩大陆一区二区| 国产精品一卡二| 一级精品视频在线观看宜春院| 欧美一级久久久久久久大片| 国产99久久久国产精品潘金| 亚洲福利国产精品| 日本一区二区三区在线不卡| 欧美亚洲日本国产| 国产精品资源站在线| 亚洲h动漫在线| 中文字幕av不卡| 日韩色在线观看| 在线视频欧美区| 从欧美一区二区三区| 日韩电影网1区2区| 麻豆国产精品视频| 亚洲免费在线播放| 久久天天做天天爱综合色| 欧美猛男男办公室激情| 97se亚洲国产综合自在线 | 欧美视频一区二区三区|