What are the advantages and disadvantages of using MD5 hashes for file names and passwords in PHP scripts?

Using MD5 hashes for file names and passwords in PHP scripts can provide some level of security by obfuscating the original data. However, MD5 is now considered to be a weak hashing algorithm and can be easily cracked using modern computing power. It is recommended to use more secure hashing algorithms like SHA-256 or bcrypt for password hashing.

// Example of using SHA-256 for password hashing
$password = "password123";
$hashed_password = hash('sha256', $password);
echo $hashed_password;