Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function verify($plain, $hashed)
 {
     return hash_equals($this->pikirasa->base64Encrypt($plain), $hashed);
 }
Пример #2
0
 public function testBase64EncryptDecrypt()
 {
     $rsa = new RSA($this->publicKeyFile, $this->privateKeyFile);
     $data = 'abc123';
     $encrypted = $rsa->base64Encrypt($data);
     // Ensure there are no unicode characters
     $this->assertRegExp('/[\\x00-\\x7F]/', $encrypted);
     $decrypted = $rsa->base64Decrypt($encrypted);
     $this->assertSame($decrypted, $data);
 }