Examples of PaddedBufferedBlockCipher


Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

        BlockCipherPadding  padding,
        SecureRandom        rand,
        byte[]              ffVector,
        byte[]              ZeroVector)
    {
        PaddedBufferedBlockCipher    cipher = new PaddedBufferedBlockCipher(new DESEngine(), padding);
        KeyParameter                 key = new KeyParameter(Hex.decode("0011223344556677"));
       
        //
        // ff test
        //
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

        return "PKCS5S2";
    }

    public TestResult perform()
    {
        BufferedBlockCipher cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new DESEngine()));
        Test                test = new PBETest(0, cipher, sample1, 64);
        TestResult          result = test.perform();

        if (!result.isSuccessful())
        {
            return new SimpleTestResult(false, getName() + ": " + result.toString());
        }

        cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new DESedeEngine()));
        test = new PBETest(1, cipher, sample2, 192);
        result = test.perform();

        if (!result.isSuccessful())
        {
            return new SimpleTestResult(false, getName() + ": " + result.toString());
        }

        cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new RC2Engine()));
        test = new PBETest(2, cipher, sample3, 0);
        result = test.perform();

        if (!result.isSuccessful())
        {
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

    {
        /*
         * Setup the DESede cipher engine, create a PaddedBufferedBlockCipher
         * in CBC mode.
         */
        cipher = new PaddedBufferedBlockCipher(
                                    new CBCBlockCipher(new DESedeEngine()));

        /*
         * The input and output streams are currently set up
         * appropriately, and the key bytes are ready to be
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

        }

        //
        // twofish with IV0 test
        //
        BufferedBlockCipher c1 = new PaddedBufferedBlockCipher(
                                    new CBCBlockCipher(new TwofishEngine()));
        BufferedBlockCipher c2 = new PaddedBufferedBlockCipher(
                                    new CBCBlockCipher(new TwofishEngine()));
        i1 = new IESEngine(
                       new ECDHBasicAgreement(),
                       new KDF2BytesGenerator(new SHA1Digest()),
                       new HMac(new SHA1Digest()),
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

    // Initialize the cryptographic engine.
    // The string should be at least 8 chars long.
    public Encryptor(String key) {
        this.password = this.padKey(key);
        cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new TwofishEngine()));
    }
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

   
    /** Creates a new instance of AESCipher */
    public AESCipher(boolean forEncryption, byte[] key, byte[] iv) {
        BlockCipher aes = new AESFastEngine();
        BlockCipher cbc = new CBCBlockCipher(aes);
        bp = new PaddedBufferedBlockCipher(cbc);
        KeyParameter kp = new KeyParameter(key);
        ParametersWithIV piv = new ParametersWithIV(kp, iv);
        bp.init(forEncryption, piv);
    }
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

            this.cipher = cipher;
        }

        BufferedGenericBlockCipher(BlockCipher cipher)
        {
            this.cipher = new PaddedBufferedBlockCipher(cipher);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

            this.cipher = new PaddedBufferedBlockCipher(cipher);
        }

        BufferedGenericBlockCipher(BlockCipher cipher, BlockCipherPadding padding)
        {
            this.cipher = new PaddedBufferedBlockCipher(cipher, padding);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

  public CryptoHandler(BlockCipher rAlgorithm, byte[] rKey)
  {
    SHA1Digest aDigest = new SHA1Digest();
    byte[]     aKey    = new byte[32];

    aCipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(rAlgorithm));

    aDigest.update(rKey, 0, rKey.length);
    aDigest.doFinal(aKey, 0);

    for (int i = aDigest.getDigestSize(); i < aKey.length; i++)
View Full Code Here

Examples of org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher

        int         pbeType,
        int         pbeHash,
        int         pbeKeySize,
        int         pbeIvSize)
    {
        cipher = new PaddedBufferedBlockCipher(engine);

        this.pbeType = pbeType;
        this.pbeHash = pbeHash;
        this.pbeKeySize = pbeKeySize;
        this.pbeIvSize = pbeIvSize;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.