[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iaik-jce] Two-keyed 3DES ...

When initializing the key generator, just specify 112 (2x56) as key strength
instaed of 168 for using two-keyed Triple-DES, e.g.:

KeyGenerator kg = KeyGenerator.getInstance("3DES");
kg.init(112, null);
Key key = kg.generateKey();

If you want to supply the key material immediately, use 16 bytes instead of
24 bytes, e.g.:

byte[] key_material = { ... }; // 16 bytes
key = new iaik.security.cipher.SecretKey(key_material, "RAW");

Dieter Bratko