Jump to content
Sign in to follow this  
Greywacke 2k19

Hi again, there...

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

Share this post


Link to post
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>

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...