What are the key differences between standard SHA1 encryption and SSHA encryption in the context of PHP development?

Standard SHA1 encryption produces a fixed-length hash value, while SSHA (Salted SHA) encryption adds a random salt to the input before hashing, resulting in a different hash value each time even if the input is the same. This makes SSHA more secure against rainbow table attacks. In PHP development, it is recommended to use SSHA encryption for storing passwords securely.

$password = "password123";
$salt = openssl_random_pseudo_bytes(16); // Generate a random salt
$hashed_password = "{SSHA}" . base64_encode(sha1($password . $salt, true) . $salt);