I examine Jasypt for storing database encrypted passwords in property files. It has good integration with Spring etc., but approach of that this guys propose for encrypting password looks a bit weird as for me:
Use PBE (symmetric algorithm) encryption.
Store password for encryption/decryption in environment variable or in source code.
Both options look unsafe and a bit insecure.
My questions:
- What is the best practice for storing encrypted passwords?
- Can I use key based encryption (i.e. private/public keys) here?