In Java, you can use the javax.crypto package to perform 256-bit AES (Advanced Encryption Standard) encryption.
To securely hash and salt passwords in PHP, you can use the password_hash function.
It is generally considered more secure to use a char[] array to store passwords because it can be wiped from memory more easily than a String object.