Jasypt keeps a database password out of plain text in a Spring Boot project's application.properties โ here's how it actually works.
What Jasypt does
A sensitive config value gets wrapped as ENC(encrypted-value), and the application decrypts it at startup using a specified algorithm (commonly PBEWITHHMACSHA512ANDAES_256) and a master password. The point is keeping a plaintext password out of a config file that gets committed to a repository.
Managing the master password is the crux of it
Decrypting the value requires the master password โ and committing that password alongside the config file defeats the entire purpose of encrypting it. Keep the master password separate, via an environment variable (JASYPT_ENCRYPTOR_PASSWORD) or a dedicated secrets manager.
The limits of this approach
Jasypt encryption protects against a leaked repository or config file, but it's defeated if the master password itself leaks too (an exposed server environment variable, for instance). For stronger isolation, consider a dedicated secrets service like AWS Secrets Manager or HashiCorp Vault.