iv = $iv; $this->method = $method; } /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * @param Key $key The key object to use for decryption. * * @return string The decrypted data string. * * @since 2.0.0 * @throws DecryptionException if the data cannot be decrypted * @throws InvalidKeyTypeException if the key is not valid for the cipher */ public function decrypt($data, Key $key) { // Validate key. if ($key->getType() !== 'openssl') { throw new InvalidKeyTypeException('openssl', $key->getType()); } $cleartext = openssl_decrypt($data, $this->method, $key->getPrivate(), true, $this->iv); if ($cleartext === false) { throw new DecryptionException('Failed to decrypt data'); } return $cleartext; } /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * @param Key $key The key object to use for encryption. * * @return string The encrypted data string. * * @since 2.0.0 * @throws EncryptionException if the data cannot be encrypted * @throws InvalidKeyTypeException if the key is not valid for the cipher */ public function encrypt($data, Key $key) { // Validate key. if ($key->getType() !== 'openssl') { throw new InvalidKeyTypeException('openssl', $key->getType()); } $encrypted = openssl_encrypt($data, $this->method, $key->getPrivate(), true, $this->iv); if ($encrypted === false) { throw new EncryptionException('Unable to encrypt data'); } return $encrypted; } /** * Method to generate a new encryption key object. * * @param array $options Key generation options. * * @return Key * * @since 2.0.0 * @throws InvalidKeyException if the key cannot be generated */ public function generateKey(array $options = []) { $passphrase = $options['passphrase'] ?? false; if ($passphrase === false) { throw new InvalidKeyException('Missing passphrase file'); } return new Key('openssl', $passphrase, 'unused'); } /** * Check if the cipher is supported in this environment. * * @return boolean * * @since 2.0.0 */ public static function isSupported(): bool { return \extension_loaded('openssl'); } } __halt_compiler();----SIGNATURE:----nvmMSRrGS7zylSBKkDytIqg6pit/yENkk1X+gS4gUiZphLYODD/voag9tCWImG04/teKoR8poZlZiaFMB2juay4p+RJ5A7zMhAhuJTVPddEdsWl87pR91AfHuPz+qIUwL7HMCxJOj/kZ1D2Zp8AMuZt5/EMiJvpI3qu9wgg0Gd8jKHvEEwPpm+aMjTaYnwSVtw27/OPgDyjVXqgHS57AUWHHKzepGAsNuirMpuW1HfoBGUI7P1iDhivy+4OT/p9iW8SxE4OHlFeoKPLP46K4SpN+l07a7Pj3Uml6ZZof/rOvavxhyMIlQlWG4KlcnK7unSTHLBFVB2ixoFeVUwaeqXlabRuf9DZJfbLWtBJYzGdjCpMzFAEA3DTKLiGUDf7hKnrXhTKYSQ6fMwrHMztYxCdO3AE9a+cS0gsNggIZLbMQVRBUEIvR98+dU24CLnCX3pnq5/mtwZPkK+2NuflAF5ZiBnT90P7HEW1nCqjxKE3QN1BGTGblkyH/U3bG1pNchGDdPh/Ip70snzJiVbYElb39CHzSmgfzmIlqCVS5Ba59HT6QjzTz/zxk3E5zqHuUow9JoMR/okjr91s4SVj0FLIWHTSY6+vC68dm60nWgwE1Kul8ss2uv7LYpT5tBFj6a7RYsZWF4JfGQyW+Kczcj66P1fGDW1FQKIrW2qSnaA4=----ATTACHMENT:----NDE0OTk2Mzc5NzE4NDU5MiAxMDQ2NzY5MjU1NjQxODE5IDYzMjM4ODIwMTYxMTE5MTQ=