DEV Community

Discussion on: How to Securely Store a Password in Java

Collapse
 
rafasmxp profile image
rafuru

It's a great idea to toss the password string to the garbage collector ASAP, I've saw a lot of implementation which doesn't consider this fact.

Collapse
 
awwsmm profile image
Andrew (he/him)

Yeah, unfortunately, there's no way to force garbage collection in Java. You can only suggest it by calling System.gc().

Collapse
 
ondrejs profile image
Ondrej

Correct. Good article btw, I would probably use the Kotlin/Java implementation of NaCl library but in this case the ones you used are strong enough.