How can you prevent sensitive data leakage in Java applications?
Sensitive data leakage can be mitigated by securely storing passwords using hash functions like SHA-256 and salting them before storing.
Thatâ€™s partially correct. While hashing and salting passwords are crucial for secure storage, the encryption of sensitive data during transmission is also important.
Can you describe how to use Java's `Cipher` class for encrypting sensitive data during transmission?