Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best encryption/decryption with salt in PHP 7 [duplicate]

Tags:

php

encryption

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

like image 268
Attila Naghi Avatar asked May 05 '26 20:05

Attila Naghi


1 Answers

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

  • http://php.net/manual/es/function.openssl-encrypt.php
  • http://php.net/manual/es/function.openssl-decrypt.php

Hope it helps!

like image 143
nahuelhds Avatar answered May 07 '26 09:05

nahuelhds



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!