Java控制台;readPassword,数组如何防止确定密码值? [英] Java Console; readPassword, how does an array protect from determining the password value?
本文介绍了Java控制台;readPassword,数组如何防止确定密码值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在阅读其中一本Java认证书中的 java.io.Console
类,可能我错过了上一章的基础知识,但是有人可以在下面解释吗?
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?
它提到, readPassword
方法返回一个字符数组而不是字符串,以防止潜在的黑客找到该字符串,然后找到密码.
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?
推荐答案
查看全文