简体   繁体   English

在Java中动态保存用户名和密码信息的好/安全方法是什么?

[英]What is a good/safe way to dynamically save a username and password information in Java?

Ideally I would do this with environment variables however that is not an option for me right now. 理想情况下,我将使用环境变量来执行此操作,但是现在这不是我的选择。 Is there some other way that I can dynamically save information such as the username and password? 还有其他方法可以动态保存用户名和密码等信息吗? For the time being I am doing this 目前我正在这样做

private final static String USER = "*****";
private final static String PASSWORD = "*******";

If you are going to persist it. 如果您要坚持下去。 Hash it with a salt 撒上盐

this is a good reference to start: 这是开始的良好参考:

https://crackstation.net/hashing-security.htm#javasourcecode https://crackstation.net/hashing-security.htm#javasourcecode

you can choose to save it in a database or just plain file. 您可以选择将其保存在数据库中或仅保存为纯文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Java 中将有用的状态信息传递给异常的好方法是什么? - What is a good way to pass useful state information to an exception in Java? 如何通过可序列化保存和读取用户信息(用户名,密码等)? - How to save and read user information (username ,password,and so on) by serializable? 如何将用户信息(用户名,密码等)保存和读取到Excel? - How to save and read user information (username ,password,and so on) to a excel? 保存密码/用户名信息 - Saving Password/Username Information Java-从文件读取时动态地在循环中插入用户名和密码 - Java - Dynamically insert username and password in loop when reading from file 在 Java 中创建临时文件的安全方法是什么? - What is a safe way to create a Temp file in Java? 什么是安全的Java applet - > MySQL的沟通方式 - What is safe way to communicate java applet -> MySQL 最理想的方法是在类中保存密码 - Java - Most desirable way to save password in a class - Java 为 Ant SCP 任务存储用户名/密码的最佳方法是什么 - what's the best way to store username/password for Ant SCP task JAVA-检索/将用户名和密码存储到服务器的安全方法? - JAVA - Secure way of retrieving / storing username & password to a server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM