Package org.bouncycastle.crypto.modes

Examples of org.bouncycastle.crypto.modes.SICBlockCipher


                  byte[] iv = new byte[16];
                  SecureRandom rng = NodeStarter.getGlobalSecureRandom();
                  rng.nextBytes(key);
                  rng.nextBytes(iv);
                  AESFastEngine e = new AESFastEngine();
                  SICBlockCipher ctr = new SICBlockCipher(e);
                  ctr.init(true, new ParametersWithIV(new KeyParameter(key),iv));
                  cis = new CipherInputStream(zis, new BufferedBlockCipher(ctr));
                  cisCounter = 0;
              }
              read = cis.read(buffer, 0, ((remaining > BUFFER_SIZE) || (remaining == -1)) ? BUFFER_SIZE : (int) remaining);
              cisCounter += read;
View Full Code Here


            if (ivLength < 16)
            {
                throw new IllegalArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)");
            }
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine)));
        }
        else if (modeName.startsWith("CTR"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine)));
        }
        else if (modeName.startsWith("GOFB"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
View Full Code Here

            if (ivLength < 16)
            {
                throw new IllegalArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)");
            }
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine)));
        }
        else if (modeName.startsWith("CTR"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine)));
        }
        else if (modeName.startsWith("GOFB"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
View Full Code Here

            if (ivLength < 16)
            {
                throw new IllegalArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)");
            }
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine)));
        }
        else if (modeName.startsWith("CTR"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine)));
        }
        else if (modeName.startsWith("GOFB"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
View Full Code Here

            if (ivLength < 16)
            {
                throw new IllegalArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)");
            }
            cipher = new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine));
        }
        else if (modeName.startsWith("CTR"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine));
        }
        else if (modeName.startsWith("GOFB"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedBlockCipher(
View Full Code Here

            if (ivLength < 16)
            {
                throw new IllegalArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)");
            }
            cipher = new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine));
        }
        else if (modeName.startsWith("CTR"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine));
        }
        else if (modeName.startsWith("GOFB"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedBlockCipher(
View Full Code Here

    // checksum added to the end of the encrypted data, update on each encryption call
    this.mac = new HMac( new SHA1Digest() );
    mac.init( new KeyParameter(authenticationCodeBytes) );

    this.aesCipher = new SICBlockCipher(new AESEngine());
    this.blockSize = aesCipher.getBlockSize();

    // incremented on each 16 byte block and used as encryption NONCE (ivBytes)
    nonce = 1;
  }
View Full Code Here

    // checksum added to the end of the encrypted data, update on each encryption call
    this.mac = new HMac( new SHA1Digest() );
    mac.init( new KeyParameter(authenticationCodeBytes) );

    this.aesCipher = new SICBlockCipher(new AESEngine());
    this.blockSize = aesCipher.getBlockSize();

    // incremented on each 16 byte block and used as encryption NONCE (ivBytes)
    nonce = 1;
   
View Full Code Here

            if (ivLength < 16)
            {
                throw new IllegalArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)");
            }
            cipher = new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine));
        }
        else if (modeName.startsWith("CTR"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedBlockCipher(
                        new SICBlockCipher(baseEngine));
        }
        else if (modeName.startsWith("GOFB"))
        {
            ivLength = baseEngine.getBlockSize();
            cipher = new BufferedBlockCipher(
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.modes.SICBlockCipher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.