What are the potential security risks of using simple substitution ciphers like ROT13 in PHP?

Using simple substitution ciphers like ROT13 in PHP can pose security risks as they are easily breakable and provide only minimal encryption. To enhance security, it is recommended to use stronger encryption algorithms such as AES or RSA.

// Example of using AES encryption in PHP
$plaintext = "Hello, world!";
$key = "secretkey";
$iv = random_bytes(16); // generate random initialization vector

$ciphertext = openssl_encrypt($plaintext, 'AES-256-CBC', $key, 0, $iv);
echo "Encrypted text: " . $ciphertext . "\n";

$decrypted = openssl_decrypt($ciphertext, 'AES-256-CBC', $key, 0, $iv);
echo "Decrypted text: " . $decrypted . "\n";