Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security SecProg
[Top] [All Lists]

Re: Doubt in Security basics

Subject: Re: Doubt in Security basics
Date: Tue, 15 Feb 2005 17:42:06 +0100
Babu Kopparam wrote:

Hi! List,

Probably i feel this doubt is related with basic knowledge.

Whenever capturing the password, char[] is used instead of String object. What 
purpose does this solve.
  ---  I am referring to JAVA.

It seems to me that it's a matter of who controls the password. When you use java.lang.String for passwords, you never know where the string containing the password is saved, and when the password will be erased.


Using a char[] allows you to erase the password after use:

for (int i = 0; i < password.length; i++)
    password[i] = 'X';

In that case you just need no make sure that the char[] is never given to any other function which could copy the password out of the "safe" storage.

Roland

<Prev in Thread] Current Thread [Next in Thread>