mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Cleanup RainLoop used crypt methods
This commit is contained in:
parent
9dae4cfa45
commit
59cb0978c7
|
@ -27,26 +27,16 @@ class Utils
|
|||
*/
|
||||
SHORT_TOKEN = 'smsession';
|
||||
|
||||
public static function EncryptString(string $sString, string $sKey) : string
|
||||
{
|
||||
return \MailSo\Base\Crypt::Encrypt($sString, $sKey);
|
||||
}
|
||||
|
||||
public static function DecryptString(string $sEncryptedString, string $sKey) : string
|
||||
{
|
||||
return \MailSo\Base\Crypt::Decrypt($sEncryptedString, $sKey);
|
||||
}
|
||||
|
||||
public static function EncodeKeyValues(array $aValues, string $sCustomKey = '') : string
|
||||
{
|
||||
return \MailSo\Base\Utils::UrlSafeBase64Encode(
|
||||
static::EncryptString(\json_encode($aValues), \md5(APP_SALT.$sCustomKey)));
|
||||
\MailSo\Base\Crypt::Encrypt(\json_encode($aValues), \md5(APP_SALT.$sCustomKey)));
|
||||
}
|
||||
|
||||
public static function DecodeKeyValues(string $sEncodedValues, string $sCustomKey = '') : array
|
||||
{
|
||||
return static::unserialize(
|
||||
static::DecryptString(\MailSo\Base\Utils::UrlSafeBase64Decode($sEncodedValues), \md5(APP_SALT.$sCustomKey))
|
||||
\MailSo\Base\Crypt::Decrypt(\MailSo\Base\Utils::UrlSafeBase64Decode($sEncodedValues), \md5(APP_SALT.$sCustomKey))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -77,11 +67,6 @@ class Utils
|
|||
}
|
||||
}
|
||||
|
||||
public static function Fingerprint() : string
|
||||
{
|
||||
return \sha1(\preg_replace('/[^a-z]+/i', '', \explode(')', $_SERVER['HTTP_USER_AGENT'])[0]));
|
||||
}
|
||||
|
||||
public static function GetShortToken() : string
|
||||
{
|
||||
$sToken = static::GetCookie(self::SHORT_TOKEN, null);
|
||||
|
|
Loading…
Reference in a new issue