java - Interning of String.valueOf() -
whilst handling passwords in java, understanding should handled in char[]'s allow gc , remove hanging references.
my question would,
char[] password = string.valueof(authentication.getcredentials()).tochararray();
could value of authentication.getcredentials() interned or not?
string.valueof()
doesn't intern strings. way intern strings during runtime password.intern()
. there's no need use using char[]
passwords.char[]
allows clear array directly after use, narrowing attacker's timeframe dump memory , retrieve plaintext password.
a string nothing special gc. interning affects bit, in regular use wouldn't encounter out of ordinary.
Comments
Post a Comment