Page 1 of 1

Question about DESKey

Posted: Thu Dec 01, 2016 3:11 am
by dabluwt
Can I create DESKey in transient memory? Will DESKey keep the key data permanently?

Re: Question about DESKey

Posted: Thu Dec 01, 2016 6:07 am
by tay00000
Yes it can be transient memory key.

DESKey myDesKey = KeyBuilder.buildKey(KeyBuilder.TYPE_DES_TRANSIENT_RESET, KeyBuilder.LENGTH_DES, false);

Once you have finished using the myDesKey or whatever transient DES key or keys, just called myDesKey.clearKey(); or whatever key name with the clearKey() function. This will zeroize the key from memory. If by accident or chance your card's power were to trip or the card removed unexpectedly, the memory will also be cleared since it's RAM/transient in nature.

Look at the KeyBuilder API (http://www.javafind.net/library/111/jav ... mmary.html) and select your desired key type (DES, 2DES, 3DES ...etc...) and TRANSIENT_RESET or TRANSIENT_DESELECT type (read the API).

Re: Question about DESKey

Posted: Fri Dec 02, 2016 5:48 am
by dabluwt
Thank you very much for your detailed answer. It helps me a lot . :lol: