guil95 / encryption
Encryption string by openssl
2.0.0
2020-05-18 17:58 UTC
This package is auto-updated.
Last update: 2025-03-19 05:39:46 UTC
README
Encrypt
/** * @param string $value * @return array */ $encrypt = (new Encryption('SECRET_KEY', 'SECRET_IV'))->encrypt($value); // returns /** [ ['encryption'] => 'U2NZUzRXUGdNQXhZb2JIYmpEbjV5UT09', ['secretKey'] => '9be3012dcf7250872a8f59ee7bec763da5f263fb2a4cdb23cea25bb105df915925663dfcb54cf1cad7e9d41b53437833bda9909eb1f3d4b3dfa24689f7036bea', ['iv'] => 'bc450f24e0553f98' ] */
Decrypt
/** * @param string $encrypt * @return string */ $decrypt = (new Encryption('SECRET_KEY', 'SECRET_IV'))->decrypt($encrypt);