Beispiel #1
0
 public function testDecrypt()
 {
     $keys = System_Rsa_Keygen::Generate();
     $rsa = new System_Rsa_Rsalib($keys['module'], $keys['public'], $keys['private']);
     $output = $rsa->encrypt($this->_testString);
     $output = $rsa->decrypt($output);
     $this->assertEquals($this->_testString, $output);
 }
Beispiel #2
0
 /**
  * Дешифруем пароль
  *
  * @param string $password
  * @return string
  */
 protected function _decodePassword($password)
 {
     $keys = $this->_getSessionKeys();
     $rsa = new System_Rsa_Rsalib($keys->module, $keys->public, $keys->private);
     return $rsa->decrypt($password);
 }