I successfully encode and decode a string, but i don't succeed with a ini file.
What i want :
Read a data in INI file, encode it, then replace it in the ini_file
After that, i want to read the ini file and decrypt the data
But this does'nt work, i think it's a problem of format (Binary/String ) but i don't succeed
$password = "123456" $adresse_ftp = IniRead($path_directive,"FTP","url","[NOT_FOUND]") $adresse_ftp_crypted =_Crypt_EncryptData($adresse_ftp ,$password,$CALG_AES_256) IniWrite($fichier_ini ,"FTP","url",$adresse_ftp_crypted) $adresse_ftp = IniRead($path_directive,"FTP","url","[NOT_FOUND]") _FileWriteLog($log_file,$adresse_ftp) if StringLeft($adresse_ftp,2) = "0x" then $adresse_ftp = BinaryToString(_Crypt_DecryptData($adresse_ftp , $password, $CALG_AES_256)) _FileWriteLog($log_file,$adresse_ftp)
This give me this result ( before decrypt / after decrypt ):
2011-03-28 15:04:46 : 0x0AE9B9CBDEE341E4313D442CC8CBF58A 2011-03-28 15:04:46 : ÿÿÿÿ
Again if i do the same code, but without passthrought an ini file, all works...
Any help would be apprecied...
Edited by pinkfoyd, 28 March 2011 - 01:17 PM.




