Archive: processing data through inetc and php


processing data through inetc and php
I am trying to encrypt the users password using the php script from my website so i can compare it to the MD5 string saved on my database to verify user account information. I am using the following code in my installer. As of now it is not processing any of the data. I am relatively new to PHP so im not sure if the issue is with syntax of the nsis script or the php script.

inetc:: post $user_pass "address/to/phpfile.php" $encrypted_pass
MessageBox MB_OK "$encrypted_pass"

This is the php file i am calling

<?php
include "encryption.php"
$data = $_POST
$encryption = new EncryptionClass::encrypt($data)
?>


Try echoing the return value ($encryption), so that inetc actually gets something to download.

Anyway, why don't you implement the encryption in NSIS? If all you want is an MD5 hash, simply use the MD5 plugin. At least that'd be slightly safer than sending the actual plaintext password.


I echoed the return value but still no response. I also tried the md5dll plugin but the returned string does not match the ones saved on my database. Is there anything else I can change in the PHP or should I find some other method?


You are using inetc wrong. Read the usage again. It requires a file path to save to, which you then read from using FileRead.

I have used the MD5 plug-in without issues in the past. Make sure you are using the ANSI version if you are not using Unicode NSIS. That said, I would avoid using MD5 (and SHA1 for that matter).

Stu


Thanks Stu, I was in a hurry and skimmed over the word "file". Trust me, if I had control over the web server I would change a lot so I have to use the encryption they use. I fixed the script in the NSIS side and now I am not sure if the php file is even receiving the data from the installer. The example script is in pearl and I need to translate it. I'm kinda new to php myself so I'll try to look it up but any help would be appreciated. Thanks again guys! You all have been a big help in my project! :)