Merge pull request #918 from anaggh/master

Remove unused deprecated Crypt class
This commit is contained in:
Diego Najar 2019-01-19 21:05:09 +01:00 committed by GitHub
commit 90e770ee9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 41 deletions

View File

@ -1,41 +0,0 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Crypt {
// return string
public static function encrypt($string, $key)
{
if(function_exists('get_loaded_extensions'))
{
if( in_array('mcrypt', get_loaded_extensions()) )
{
$string = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5($key) ) );
return $string;
}
}
return('---');
}
// return string
public static function decrypt($string, $key)
{
if(function_exists('get_loaded_extensions'))
{
if( in_array('mcrypt', get_loaded_extensions()) )
{
$string = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5($key) ), "\0" );
return $string;
}
}
return('---');
}
public static function getHash($string, $salt = '$#!')
{
$sha1 = sha1($string.$salt);
return($sha1);
}
}