Examples of DESEngine


Examples of com.maverick.crypto.engines.DESEngine

     * @return Cipher The cipher.
     * @throws IOException If the cipher cannot be retrieved.
     */
    private DESEngine getCipher(byte[] key) throws IOException {

        DESEngine cipher = new DESEngine();
        key = setupKey(key);
        cipher.init(true, key);
        return cipher;

    }
View Full Code Here

Examples of com.maverick.crypto.engines.DESEngine

     * @return byte[] The encrypted data
     * @throws HttpException If {@link Cipher.doFinal(byte[])} fails
     */
    private byte[] encrypt(byte[] key, byte[] bytes) throws IOException {

        DESEngine cipher = getCipher(key);
        byte[] enc = cipher.doFinal(bytes);
        return enc;

    }
View Full Code Here

Examples of net.sourceforge.jtds.util.DESEngine

    public static byte[] answerLmChallenge(String pwd, byte[] nonce)
        throws UnsupportedEncodingException {
        byte[] password = convertPassword(pwd);

        DESEngine d1 = new DESEngine(true, makeDESkey(password,  0));
        DESEngine d2 = new DESEngine(true, makeDESkey(password,  7));
        byte[] encrypted = new byte[21];
        Arrays.fill(encrypted, (byte)0);

        d1.processBlock(nonce, 0, encrypted, 0);
        d2.processBlock(nonce, 0, encrypted, 8);

        return encryptNonce(encrypted, nonce);
    }
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

    static public class BrokePBEWithSHA1AndDES
        extends BrokenJCEBlockCipher
    {
        public BrokePBEWithSHA1AndDES()
        {
            super(new CBCBlockCipher(new DESEngine()), PKCS5S1, SHA1, 64, 64);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

    static public class BrokePBEWithMD5AndDES
        extends BrokenJCEBlockCipher
    {
        public BrokePBEWithMD5AndDES()
        {
            super(new CBCBlockCipher(new DESEngine()), PKCS5S1, MD5, 64, 64);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

        doTest("DHIES with 1024-bit", g, "DHIES", params);

        c1 = new IESCipher(new IESEngine(new DHBasicAgreement(),
                new KDF2BytesGenerator(new SHA1Digest()),
                new HMac(new SHA1Digest()),
                new PaddedBufferedBlockCipher(new DESEngine())));
       
        c2 = new IESCipher(new IESEngine(new DHBasicAgreement(),
                new KDF2BytesGenerator(new SHA1Digest()),
                new HMac(new SHA1Digest()),
                new PaddedBufferedBlockCipher(new DESEngine())))
   
        params = new IESParameterSpec(derivation, encoding, 128, 192);
     
        // Testing DHIES with default prime using DESEDE
        g = KeyPairGenerator.getInstance("DH", "BC");
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

    static public class DES_CFB8
        extends JCEStreamCipher
    {
        public DES_CFB8()
        {
            super(new CFBBlockCipher(new DESEngine(), 8), 64);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

    static public class DES_OFB8
        extends JCEStreamCipher
    {
        public DES_OFB8()
        {
            super(new OFBBlockCipher(new DESEngine(), 8), 64);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

        }
       
        cipher.processBlock(buf, 0, mac, 0);

        // Added to code from base class
        DESEngine deseng = new DESEngine();
       
        deseng.init(false, this.lastKey2);
        deseng.processBlock(mac, 0, mac, 0);
       
        deseng.init(true, this.lastKey3);
        deseng.processBlock(mac, 0, mac, 0);
        // ****
       
        System.arraycopy(mac, 0, out, outOff, macSize);
       
        reset();
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine

    static public class ECB
        extends BaseBlockCipher
    {
        public ECB()
        {
            super(new DESEngine());
        }
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.