public DES() { super(new DESEngine()); } }
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);
public int processBlock( byte[] in, int inOff, byte[] out, int outOff) { if (workingKey == null) { throw new IllegalStateException("DES engine not initialised"); } if ((inOff + BLOCK_SIZE) > in.length) { throw new DataLengthException("input buffer too short"); } if ((outOff + BLOCK_SIZE) > out.length) { throw new OutputLengthException("output buffer too short"); } desFunc(workingKey, in, inOff, out, outOff); return BLOCK_SIZE; }
/** * initialise a DES cipher. * * @param encrypting whether or not we are for encryption. * @param params the parameters required to set up the cipher. * @exception IllegalArgumentException if the params argument is * inappropriate. */ public void init( boolean encrypting, CipherParameters params) { if (params instanceof KeyParameter) { if (((KeyParameter)params).getKey().length > 8) { throw new IllegalArgumentException("DES key too long - should be 8 bytes"); } workingKey = generateWorkingKey(encrypting, ((KeyParameter)params).getKey()); return; } throw new IllegalArgumentException("invalid parameter passed to DES init - " + params.getClass().getName()); }
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);
public int processBlock( byte[] in, int inOff, byte[] out, int outOff) { if (workingKey == null) { throw new IllegalStateException("DES engine not initialised"); } if ((inOff + BLOCK_SIZE) > in.length) { throw new DataLengthException("input buffer too short"); } if ((outOff + BLOCK_SIZE) > out.length) { throw new DataLengthException("output buffer too short"); } desFunc(workingKey, in, inOff, out, outOff); return BLOCK_SIZE; }
/** * initialise a DES cipher. * * @param encrypting whether or not we are for encryption. * @param params the parameters required to set up the cipher. * @exception IllegalArgumentException if the params argument is * inappropriate. */ public void init( boolean encrypting, CipherParameters params) { if (params instanceof KeyParameter) { if (((KeyParameter)params).getKey().length > 8) { throw new IllegalArgumentException("DES key too long - should be 8 bytes"); } workingKey = generateWorkingKey(encrypting, ((KeyParameter)params).getKey()); return; } throw new IllegalArgumentException("invalid parameter passed to DES init - " + params.getClass().getName()); }
public ECB() { super(new DESEngine()); } }
public ECB() { super(new DESEngine()); } }
public DESCFB8() { super(new CFBBlockCipherMac(new DESEngine())); } }
public PBEWithSHA1AndDES() { super(new CBCBlockCipher(new DESEngine())); } }
public BrokePBEWithSHA1AndDES() { super(new CBCBlockCipher(new DESEngine()), PKCS5S1, SHA1, 64, 64); } }
public DES64() { super(new CBCBlockCipherMac(new DESEngine(), 64)); } }
public CMAC() { super(new CMac(new DESEngine())); } }
public DES9797Alg3() { super(new ISO9797Alg3Mac(new DESEngine())); } }
public PBEWithSHA1() { super(new CBCBlockCipher(new DESEngine()), PKCS5S1, SHA1, 64, 8); } }
public DES64() { super(new CBCBlockCipherMac(new DESEngine(), 64)); } }
public DESCFB8() { super(new CFBBlockCipherMac(new DESEngine())); } }
public DES_CFB8() { super(new CFBBlockCipher(new DESEngine(), 8), 64); } }
public CBC() { super(new CBCBlockCipher(new DESEngine()), 64); } }