当前位置: 首页>>代码示例>>Java>>正文


Java StreamBlockCipher类代码示例

本文整理汇总了Java中org.bouncycastle.crypto.StreamBlockCipher的典型用法代码示例。如果您正苦于以下问题:Java StreamBlockCipher类的具体用法?Java StreamBlockCipher怎么用?Java StreamBlockCipher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StreamBlockCipher类属于org.bouncycastle.crypto包,在下文中一共展示了StreamBlockCipher类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: encryptOrDecrypt

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
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;
    }
 
开发者ID:jessecoyle,项目名称:jcredstash,代码行数:17,代码来源:CredStashBouncyCastleCrypto.java

示例2: CTSBlockCipher

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:21,代码来源:CTSBlockCipher.java

示例3: JCEStreamCipher

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
protected JCEStreamCipher(
    BlockCipher engine,
    int         ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:9,代码来源:JCEStreamCipher.java

示例4: BaseStreamCipher

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
protected BaseStreamCipher(
    BlockCipher engine,
    int ivLength)
{
    this.ivLength = ivLength;

    cipher = new StreamBlockCipher(engine);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:9,代码来源:BaseStreamCipher.java

示例5: createCipher

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
@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;
}
 
开发者ID:Bestoa,项目名称:shadowsocks-vertx,代码行数:9,代码来源:AESCrypto.java

示例6: getCipher

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
protected abstract StreamBlockCipher getCipher(boolean isEncrypted)
throws InvalidAlgorithmParameterException;
 
开发者ID:breakEval13,项目名称:NSS,代码行数:3,代码来源:CryptBase.java

示例7: ChunkDecrypter

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
ChunkDecrypter(StreamBlockCipher cfbAes, GeneralDigest digest) {
    this.cfbAes = Objects.requireNonNull(cfbAes);
    this.digest = Objects.requireNonNull(digest);
}
 
开发者ID:horrorho,项目名称:LiquidDonkey,代码行数:5,代码来源:ChunkDecrypter.java

示例8: getCipher

import org.bouncycastle.crypto.StreamBlockCipher; //导入依赖的package包/类
protected abstract StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException; 
开发者ID:xbw12138,项目名称:shadowsocks_android,代码行数:2,代码来源:CryptBase.java


注:本文中的org.bouncycastle.crypto.StreamBlockCipher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。