function testBasic()
 {
     $cryptText = SEncryption::encrypt('text to encrypt');
     $this->assertEqual('text to encrypt', SEncryption::decrypt($cryptText));
     $this->assertNotEqual(SEncryption::encrypt('another text to encrypt'), SEncryption::encrypt('another text to encrypt'));
 }
Exemplo n.º 2
0
 private function unpackage($cookie)
 {
     $buffer = SEncryption::decrypt($cookie);
     list($this->version, $this->created, $this->userId) = explode(self::$glue, $buffer);
 }