private function encryptCookie($data) { $key = config::get('lepton.cookieauth.key'); $c = new CryptoCipher('3DES', $key); $plain = serialize($data); return $c->encrypt($plain, true); }
/** * @description DES Cryptography Implementation */ function descrypto() { $c = new CryptoCipher(MCRYPT_DES, 'hello'); $e = $c->encrypt('helloworld'); $this->assertEquals($e, 'q8dBduudWGAuIw4LPXMCFQ=='); $this->assertEquals($c->decrypt($e), 'helloworld'); }