I was reading about the java.io.Console
class in one of the java certification books, possibly I've missed something fundamental from a previous chapter, but can someone explain the below?
It mentions, that the readPassword
method returns a character array instead of a String, to prevent a potential hacker from finding this String and then finding the password.
How is a character array safer? If you could obtain the values in the array then could you not create a script to loop through various combinations and eventually find the password anyway?