/** * 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()); }
/** * 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()); }