cipher = $cipher ?: new Crypto; // Set the encryption key[/pair)]. $this->key = $key ?: $this->generateKey(); } /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * * @return string The decrypted data string. * * @since 1.0 * @throws DecryptionException if the data cannot be decrypted * @throws InvalidKeyTypeException if the key is not valid for the cipher * @throws UnsupportedCipherException if the cipher is not supported on the current environment */ public function decrypt($data) { return $this->cipher->decrypt($data, $this->key); } /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * * @return string The encrypted data string. * * @since 1.0 * @throws EncryptionException if the data cannot be encrypted * @throws InvalidKeyTypeException if the key is not valid for the cipher * @throws UnsupportedCipherException if the cipher is not supported on the current environment */ public function encrypt($data) { return $this->cipher->encrypt($data, $this->key); } /** * Method to generate a new encryption key[/pair] object. * * @param array $options Key generation options. * * @return Key * * @since 1.0 * @throws InvalidKeyException if the key cannot be generated * @throws UnsupportedCipherException if the cipher is not supported on the current environment */ public function generateKey(array $options = []) { return $this->cipher->generateKey($options); } /** * Method to set the encryption key[/pair] object. * * @param Key $key The key object to set. * * @return Crypt Instance of $this to allow chaining. * * @since 1.0 */ public function setKey(Key $key) { $this->key = $key; return $this; } /** * Generate random bytes. * * @param integer $length Length of the random data to generate * * @return string Random binary data * * @since 1.0 */ public static function genRandomBytes($length = 16) { return random_bytes($length); } } __halt_compiler();----SIGNATURE:----AlfRjsFACFKCq0H2JrBN7JFp0uEsR/FluB9VmbkSiaEkDHEBAQCWCU8EL1Ba958npgcYT46N46yhFOiJkYBN1c0L8zRUEwFwWcTz2DD11uXub+FjiTsFZwz9J076fXoxlpiYHAe0tx29KLucnHCW+q5dQwW8UPjRnUGdRxJ3NKTUUAZZc8ysSU32/+GiURucih7XFphQlPFQjfZHmdD+slK/pl1COYkasM/RvfQ7Kt5Axl8iqsxXkM76vAWAyiFpBW9Sa5zbnG5+ninGVB/9jgECHwh6x9NVAxzfd++5VbYwnlujbsD08ZgfHo5CCSznQSJE4rRYW28w0XYopMwBgPUdQAZ0zhh7xgOlFLgqt/UXUolnM6v6MfJbrgn4NPaLDB1cv2e5ZA5zAjssRt0DrT0GBb+I9BJUvF7RyK2sN9TEU2/AuMWP4+KwmLiNXG3Uw98BQMhZXqOmXqn3MlPPXw0McjfVUJ+tKU/DHPhgwHkwSlqCZXIg4XU2LfknHY7NEsfL+o3qb5C7hYHdFBM5eDS7Hv11hJXj2i4HDyIPR2LqxwaaXE3MZGZjQg0LZJPU9bXl/XYG+5r0/RO2wcln7LVCjgCuoJEpbM9OdBGJlKCaKM6HZ5joKWFuCNFL+36Fs9DhP8hcnjs2NJ6fDbghgQpxgfea8jTEDATgbya3CEY=----ATTACHMENT:----MjE5ODQ4ODA3MTc1MzI3MCA2MzkwMjQ3MjI2OTkzODk4IDM4NzQ5NjU1NjA1NzY1OQ==