Ejemplo n.º 1
0
 /**
  * @param int $iID
  * @param string $sSalt
  *
  * @return string
  */
 public static function IdToHash($iID, $sSalt = '')
 {
     return is_int($iID) ? \bin2hex(\MailSo\Base\Crypt::XxteaEncrypt('id:' . $iID, \md5($sSalt))) : null;
 }
 /**
  * @param string $sEncriptedString
  * @param string $sKey
  *
  * @return string
  */
 public static function DecryptString($sEncriptedString, $sKey)
 {
     return \MailSo\Base\Crypt::XxteaDecrypt($sEncriptedString, $sKey);
 }
Ejemplo n.º 3
0
 /**
  * @param string $sEncriptedString
  * @param string $sKey
  *
  * @return string
  */
 public static function DecryptStringQ($sEncriptedString, $sKey)
 {
     //		if (\MailSo\Base\Utils::FunctionExistsAndEnabled('openssl_pkey_get_private'))
     //		{
     //			return \RainLoop\Utils::DecryptStringRSA($sEncriptedString,
     //				$sKey.'Q'.\RainLoop\Utils::GetShortToken());
     //		}
     return \MailSo\Base\Crypt::XxteaDecrypt($sEncriptedString, $sKey . 'Q' . \RainLoop\Utils::GetShortToken());
 }