Encrypts and decrypts data using the WordPress Salts and OpenSSL
Use the package manager composer to install WP-Encrypt.
composer require khorshid/wp-encrypt
use WP_Encryption\Encryption;
...
$encrypted_data = (new Encryption)->encrypt( $data );
// $encrypted_data is encrypted and safe to store in database.
$decrypted_data = (new Encryption)->decrypt( $encrypted_data );
// $encrypted_data = $data
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.