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 char[] passwords. using 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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -