Java 类org.bouncycastle.crypto.StreamBlockCipher 实例源码

项目:jcredstash    文件:CredStashBouncyCastleCrypto.java   
private byte[] encryptOrDecrypt(byte[] key, byte[] contents, boolean forEncryption) {

        // Credstash uses standard AES
        BlockCipher engine = new AESFastEngine();

        // Credstash uses CTR mode
        StreamBlockCipher cipher = new SICBlockCipher(engine);

        cipher.init(forEncryption, new ParametersWithIV(new KeyParameter(key), INITIALIZATION_VECTOR));

        byte[] resultBytes = new byte[contents.length];
        int contentsOffset = 0;
        int resultOffset = 0;
        cipher.processBytes(contents, contentsOffset, contents.length, resultBytes, resultOffset);
        return resultBytes;
    }
项目:gwt-crypto    文件:CTSBlockCipher.java   
/**
 * Create a buffered block cipher that uses Cipher Text Stealing
 *
 * @param cipher the underlying block cipher this buffering object wraps.
 */
public CTSBlockCipher(
    BlockCipher     cipher)
{
    if (cipher instanceof StreamBlockCipher)
    {
        throw new IllegalArgumentException("CTSBlockCipher can only accept ECB, or CBC ciphers");
    }

    this.cipher = cipher;

    blockSize = cipher.getBlockSize();

    buf = new byte[blockSize * 2];
    bufOff = 0;
}
项目:Aki-SSL    文件:CTSBlockCipher.java   
/**
 * Create a buffered block cipher that uses Cipher Text Stealing
 *
 * @param cipher the underlying block cipher this buffering object wraps.
 */
public CTSBlockCipher(
    BlockCipher     cipher)
{
    if (cipher instanceof StreamBlockCipher)
    {
        throw new IllegalArgumentException("CTSBlockCipher can only accept ECB, or CBC ciphers");
    }

    this.cipher = cipher;

    blockSize = cipher.getBlockSize();

    buf = new byte[blockSize * 2];
    bufOff = 0;
}
项目:TinyTravelTracker    文件:CTSBlockCipher.java   
/**
 * Create a buffered block cipher that uses Cipher Text Stealing
 *
 * @param cipher the underlying block cipher this buffering object wraps.
 */
public CTSBlockCipher(
    BlockCipher     cipher)
{
    if (cipher instanceof StreamBlockCipher)
    {
        throw new IllegalArgumentException("CTSBlockCipher can only accept ECB, or CBC ciphers");
    }

    this.cipher = cipher;

    blockSize = cipher.getBlockSize();

    buf = new byte[blockSize * 2];
    bufOff = 0;
}
项目:keepass2android    文件:JCEStreamCipher.java   
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:ipack    文件:JCEStreamCipher.java   
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:ipack    文件:BaseStreamCipher.java   
protected BaseStreamCipher(
    BlockCipher engine,
    int ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:KeePass2Android    文件:JCEStreamCipher.java   
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:shadowsocks-vertx    文件:AESCrypto.java   
@Override
protected StreamCipher createCipher(byte[] iv, boolean encrypt) throws CryptoException
{
    StreamBlockCipher c = getCipher(encrypt);
    ParametersWithIV parameterIV = new ParametersWithIV(new KeyParameter(mKey), iv, 0, mIVLength);
    c.init(encrypt, parameterIV);
    return c;
}
项目:CryptMeme    文件:JCEStreamCipher.java   
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:CryptMeme    文件:BaseStreamCipher.java   
protected BaseStreamCipher(
    BlockCipher engine,
    int ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:irma_future_id    文件:JCEStreamCipher.java   
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:irma_future_id    文件:BaseStreamCipher.java   
protected BaseStreamCipher(
    BlockCipher engine,
    int ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:bc-java    文件:JCEStreamCipher.java   
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:bc-java    文件:BaseStreamCipher.java   
protected BaseStreamCipher(
    BlockCipher engine,
    int ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
项目:NSS    文件:CryptBase.java   
protected abstract StreamBlockCipher getCipher(boolean isEncrypted)
throws InvalidAlgorithmParameterException;
项目:LiquidDonkey    文件:ChunkDecrypter.java   
ChunkDecrypter(StreamBlockCipher cfbAes, GeneralDigest digest) {
    this.cfbAes = Objects.requireNonNull(cfbAes);
    this.digest = Objects.requireNonNull(digest);
}
项目:shadowsocks_android    文件:CryptBase.java   
protected abstract StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException;
项目:shadowsocks-java    文件:CryptBase.java   
protected abstract StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException;