I need to save username and password in text file, in this format: username#password. Is there a way in Java to hide password characters? So, if i open that txt file password can not be read.
A txt file is a plaintext file, meaning that you can't hide its content unless you encrypt it:
Simplest way to encrypt a text file in java
Alternatively, if changing the requirements is an option, you could store a hash instead of the password:
How can I hash a password in Java?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With