Witam. Używam w swoim serwisie skryptu szyfrującego. Klon tego serwisu mam na innym hostingu i tu pojawia się problem. Skrypt na klonie musi być lekko przebudowany, bo inaczej nie szyfruje niektórych tekstów.
Cytat
SERWER 1
PHP Version 5.2.17
mcrypt support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream
Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value
<?php
class SymmetricCrypt
{
private static $msSecretKey = "SECRECT KEY"; private static $msHexaIv = "hdu8374hr96128b5d4b4f7b2fe7f7f05"; private static $msCipherAlgorithm = MCRYPT_RIJNDAEL_256
; private static $msModeAlgorithm = MCRYPT_MODE_CBC
;
public static function Encrypt
($plainString) {
$iv = pack("H*", SymmetricCrypt
::$msHexaIv); $encrypted_string = mcrypt_encrypt(
SymmetricCrypt::$msCipherAlgorithm,
SymmetricCrypt::$msSecretKey,
$plainString,
SymmetricCrypt::$msModeAlgorithm,
$iv);
}
public static function Decrypt
($encryptedString) {
$iv = pack("H*", SymmetricCrypt
::$msHexaIv); $string = pack("H*", $encryptedString); $decrypted_string = mcrypt_decrypt(
SymmetricCrypt::$msCipherAlgorithm,
SymmetricCrypt::$msSecretKey,
$string,
SymmetricCrypt::$msModeAlgorithm,
$iv);
return $decrypted_string;
}
} //koniec klasy
?>
Cytat
SERWER 2
PHP Version 5.2.16
mcrypt support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream
Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value
<?php
class SymmetricCrypt
{
private static $msSecretKey = "SECRECT KEY"; private static $msHexaIv = "hdu8374hr96128b5d4b4f7b2fe7f7f05"; private static $msCipherAlgorithm = MCRYPT_RIJNDAEL_256
; private static $msModeAlgorithm = MCRYPT_MODE_CBC
;
public static function Encrypt
($plainString) {
$iv = SymmetricCrypt::$msHexaIv;
$encrypted_string = mcrypt_encrypt(
SymmetricCrypt::$msCipherAlgorithm,
SymmetricCrypt::$msSecretKey,
$plainString,
SymmetricCrypt::$msModeAlgorithm,
$iv);
}
public static function Decrypt
($encryptedString) {
$iv = SymmetricCrypt::$msHexaIv;
$decrypted_string = mcrypt_decrypt(
SymmetricCrypt::$msCipherAlgorithm,
SymmetricCrypt::$msSecretKey,
$string,
SymmetricCrypt::$msModeAlgorithm,
$iv);
return $decrypted_string;
}
} //koniec klasy
?>
Mógłby ktoś rzucić okiem, gdzie moze tkwic problem?