你可以在钥匙上加盐。
$text = "Hello this is my word";
$method = "aes-256-ecb";
$ivlen = openssl_cipher_iv_length($method);
$iv = openssl_random_pseudo_bytes($ivlen);
$secretKey= "abcdefghilmnop10032001";
$salt_length = 10;
$salt = make_salt($salt_length); // You need to define this function
$encrypted = $salt . openssl_encrypt($text, $method, $salt . $secretKey, $options=0, $iv);
$salt = substr($encrypted, 0, $salt_length);
$decrypted = openssl_decrypt(substr($encrypted, $salt_length), $method, $salt . $secretKey, $options=0, $iv);
print_r($encrypted);
print_r('<br>');
print_r($decrypted);