Codesnippets > Inline / 3rd party

ENCRYPT$ - php backend

(1/2) > >>

Kitty Hello:
Hi,

this is the PHP code you must use to generate the same results as with ENCRYPT$/DECRYPT$.

Please - use _this_ version, not any original copy you can find.

[attachment deleted by admin]

trucidare:
Cooolio :D

Moru:
Nice, thanks!

Alex_R:
Hello!

Does anyone know if this PHP code can be used with non-english characters and Windows-1252 encoding?

Whenever I try to encrypt something like "campeón" ('champion' in Spanish) I get an encrypted string which is a different string than the string GLBasic would give with ENCRYPT$ (so that is not good). But also, when I try to decrypt this encrypted string with GLBasic the app crashes, or if I try to decrypt the string using the PHP function it returns nothing. The same PHP code works perfectly if I don't use special characters (but that is not a solution for me) or if I use UTF-8 instead of Windows-1252, but I think we need to use Windows-1252 if we want to use the encrypted string in GLBasic, don't we?

Any help or hint would be much appreciated.

The PHP code I use to test (in case you see something there that I don't):

--- Code: GLBasic ---include('blowfishEncrypt.php');
$obj = new MyBlowfish("MyStrongPswd");
$test = iconv("UTF-8","Windows-1252//TRANSLIT", "campeón");
$testEnc = $obj->encryptString($test);
$testDec = $obj->decryptString($testEnc);
echo("Encrypted: ".$testEnc."<br>Decrypted: ".$testDec);
 

spacefractal:
Use urldecode/encode functions first to convert it to base64 strings. Then it's should work.

Navigation

[0] Message Index

[#] Next page

Go to full version