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:----spoQ1bAOtminlBvcC5bDqmUIRNg62Mm3jym9GfrpfGfM7TuiwtcPPwb5A3Qj22lhfIhlvvObNJZBiKJZho6TkvXW8L59EgfjjHosdOxpe9j+vwBUyXrOT58hV00Zdg+jStG9gSiv1uU4ZqgNf58wc+uuA0vGzN2Le9UIzLBspJ8JgTcB1wuvflMDfcF/6tmQx1dMg18WOrEjTGq4/N4kO7VNm8nRic7m6x5GrwQrTrjoOOzBynSgSg/qYLoOBuB/GomeVrqcQj1l2qeyqpHczEfylhxG4dfW4QF87mZ9dTzDOq//S844U0NcjTuiqr5WaBYve4xgCH0TKh8s1Wfj2Ik3oQO9MECje6Syn5dtItlXaCHFrF5ynV9su8sDu5Y3mmkmU3PFua1iH86qb/te3lHpGCgz8eoQOX9q4RdwCP6k2tP+oscYsKY9zjhCI8Gu9m/IlP44QBSsSmKvcp3J3pGOd4X/OBWMnCggeMX/pgRonTqWS1eVQ+nRJuE1yGNCkXvWzZzZDiEAiyH5ok7fD3DZWTMu5Ur46iU598xkeeMja7/Be2O6ntATfHvtpaKSEyUyt2lP4VsR0CY/pznjYcwcDs4c+KgIJ+00fO1bg3Dtc6lFzk6mw4XhjrQ2FlDaacn3r0bE+8+b1Oc1jI9rIzi5IJdrPRgQWN7RSw+sGNE=----ATTACHMENT:----OTE4MzM2NzQxNDAwNTQyNiA1MTUzNjA4MzE0NjkyOTczIDgyMTE0ODg2OTQ3OTY0MTQ=