John
John

Reputation: 75

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 = "*******";

Upvotes: 0

Views: 200

Answers (1)

Arno_Geismar
Arno_Geismar

Reputation: 2330

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

you can choose to save it in a database or just plain file.

Upvotes: 3

Related Questions