Jump to content

Hi again, there...


Greywacke 2k19

Recommended Posts

To whomever could help me see the forest for the trees after all this while! XD

Hi all, forgot my previous login details for user Greywacke, so I am from now on Greywacke 2k19 with my latest gmail.

My current issue, is a VBS translation to PHP which, on PHP 5.6.40 should do exactly as the VBS counterpart in clientside MDB scripts.
The portion i'm struggling with in both languages, is as follows (VBS first):
<code>
...
    tempstring = Hex(temp)

If Len(tempstring) = 1 Then tempstring = "0" & tempstring

    strDataOut = strDataOut + tempstring

Next arkdata1

XOREncryption = strDataOut

End Function
...
</code>
I translated as follows to php:
<code>
...
            $tempstring = dechex($temp);
            if (strlen($tempstring) = 1) {

                $tempstring = "0" . $tempstring;

            };
            $strDataOut = $strDataOut . $tempstring;
    };
    return $strDataOut;
};
...
</code>
what is short? i'm getting an error in the browser as follows:

Fatal error: Can't use function return value in write context in C:\xampp\htdocs\default.php on line 66

i am currently at wits' end... please help someone!!!

Edited by Greywacke 2k19
Using cellphones sucks
Link to comment
Share on other sites

Hi, decided to explain.  I have to translate a function thats writen in VBS, to PHP to do exactly as the VBS counterpart does.

Which is to encrypt & decrypt certain data on a server as wel as it's clients.

I'm not getting the results i expect though... it is giving the following results:

X3174u279;000000000000000101000000000000;010101010101010000010101010101000001010101010101010000010101

The code is as follows:

<code>$test1 = getkey(false, false);
$test2 = XOREncryption($test1, "Key:  ".$test1);
$test3 = XOREncryption($test1, $test2);

echo $test1,
     ";", $test2,
     ";", $test3;</code>

Link to comment
Share on other sites

The function is suposed to be a two/way encryption & decryption function, but it returns only binaries.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...