0

I am looking for the simplest and secured way to encrypt/decrypt a string with a specific salt in PHP7

my string + specific salt = encryped data 
decode(encryped data) = my string

I saw this post, but mcrypt_encrypt seems to be deprecated. Do you have any other suggestion or example ? Thank you

Attila Naghi
  • 2,535
  • 6
  • 37
  • 59
  • See also https://stackoverflow.com/questions/16600708/how-do-you-encrypt-and-decrypt-a-php-string – iainn Jan 24 '18 at 13:24

1 Answers1

15

OpenSSL functions are a good way to go. Official docs here:

Hope it helps!

nahuelhds
  • 502
  • 4
  • 17
  • 5
    English: https://php.net/manual/en/function.openssl-encrypt.php https://php.net/manual/en/function.openssl-decrypt.php – Onimusha Jun 12 '20 at 11:29