Re: secure storage of sensitive data in J2EE [Virus Checked]
To: Kevin Conaway <email@example.com> Date: Wed, 9 Feb 2005 17:09:36 +0000
That doesn't necessarily work anyway; the JVM can always disregard it -
note the phrasing in the api for System.gc():
"Calling the gc method suggests that the Java Virtual Machine expend effort
toward recycling unused objects"
runFinalization() similarly only "suggests" it calls the finalize method of
collected objects, the JVM may still decide it's not worth doing at the
However, if the key is held in an array and you've already overwritten it,
why bother - the contents have already been destroyed and collection will
gain you nothing.
If you've used a string for some reason, you should recode it using an
array rather than praying to the garbage collector and hoping it doesn't
ignore you ...
<kevin.conaway@gm To: firstname.lastname@example.org
ail.com> cc: email@example.com, firstname.lastname@example.org
Subject: Re: secure storage of sensitive data in J2EE [Virus Checked]
Please respond to
Forcing the garbage collector to run in Java is considered bad practice
On Tue, 08 Feb 2005 22:49:30 -0500, Ashish Popli <email@example.com> wrote:
> Cant we simply force garbage collection when you are done using the
> Here is a link.
> Kevin Conaway wrote:
> > A followup question:
> > Once the data (be it a password or a key) has been read into memory,
> > what is an effective and secure way of minimizing the window that the
> > plaintext key or password is in memory?
> > If the data is read into a char  and then overwritten with junk
> > data, would that work?
> > Kevin
> > On Tue, 25 Jan 2005 09:18:15 +0000, chaim moshe <firstname.lastname@example.org>
> >>Hello list,
> >>where can I store sensitive data like encryption keys, passwords, etc.
> >>surely, you can save it in the keystore, but the catch is where do you
> >>the keystore password to protect it from external access?
> >>storing the keystore password in code or in config files is not secured
> >>In the .NET environment you have DPAPI that was designed exactly for
> >>kind of problem, the sensitive data is encrypted at the OS level with
> >>user/machine password and is decrypted at runtime.
> >>What is the solution in the J2EE environment ?
> >>Express yourself instantly with MSN Messenger! Download today it's