I am Sajadh, author of this blog. I run this with loads of passion. If you are into java, you may find lot of interesting things around ... Advance thanks for your queries to sajadhaja90@gmail.com.
Since Strings are immutable in Java if you store password as plain text it will be available in memory until Garbage collector clears it and since String are used in String pool for reusability there is pretty high chance that it will be remain in memory for long duration, which pose a security threat. Since any one who has access to memory dump can find the password in clear text
Why character array is better than String for Storing password in Java
ReplyDeleteSince Strings are immutable in Java if you store password as plain text it will be available in memory until Garbage collector clears it and since String are used in String pool for reusability there is pretty high chance that it will be remain in memory for long duration, which pose a security threat. Since any one who has access to memory dump can find the password in clear text
ReplyDeleteRead more: http://javarevisited.blogspot.com/2012/03/why-character-array-is-better-than.html#ixzz2KzNZLe6x