mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Cleanup RainLoop used crypt methods
This commit is contained in:
parent
9dae4cfa45
commit
59cb0978c7
1 changed files with 2 additions and 17 deletions
|
|
@ -27,26 +27,16 @@ class Utils
|
||||||
*/
|
*/
|
||||||
SHORT_TOKEN = 'smsession';
|
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
|
public static function EncodeKeyValues(array $aValues, string $sCustomKey = '') : string
|
||||||
{
|
{
|
||||||
return \MailSo\Base\Utils::UrlSafeBase64Encode(
|
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
|
public static function DecodeKeyValues(string $sEncodedValues, string $sCustomKey = '') : array
|
||||||
{
|
{
|
||||||
return static::unserialize(
|
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
|
public static function GetShortToken() : string
|
||||||
{
|
{
|
||||||
$sToken = static::GetCookie(self::SHORT_TOKEN, null);
|
$sToken = static::GetCookie(self::SHORT_TOKEN, null);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue