简体   繁体   中英

Which would be the best way of encryption for following scenario?

I want to know which would be the best java encryption type I can use to secure my application authentication details. In my application I have to use credentials for database and one application. I am putting it in one properties file.

db_username = abc
db_password = password 

If I dont want my password to be visible in properties file. But I cant hardcode it in my application. Its a command prompt application and run using script which runs it automatically. What are the available encryption methods I can use?

Thanks..

You could take the username and password as arguments to your program, which you would call like this for example:

java -jar yourProgram -user john -pass 1234

You then move the security issue to the OS (make sure your batch is only accessible by authorised users).

Alternatively you can pass a properties file, which you place is a secure location.

See also this related post .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM