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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -