Home Why is char[] preferred over String for passwords?
Reply: 0

Why is char[] preferred over String for passwords?

user434
1#
user434 Published in April 24, 2018, 6:38 am

In Swing, the password field has a getPassword() (returns char[]) method instead of the usual getText() (returns String) method. Similarly, I have come across a suggestion not to use String to handle passwords.

Why does String pose a threat to security when it comes to passwords? It feels inconvenient to use char[].

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.483609 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO