Jump to content

code decode string


Acce
 Share

Recommended Posts

Im trying to generate a signature, Here is the javascript code that generates the code 

 

  _generateRequestPayloadSignature: function(a) {
        return Ea.substr(sQ.encode(this._hash + "A3s8Y8368IWD+LhkP9atK/hZkfb0U2RarDNBZhGjh0gz0KQ8usvHyZkah2j4mcfTVaDEZVmuf2ZRoyt91a295g==" + a), 0, 10)
      }

 

To be honest I dont understand how this work , but is it possible to make the same code for autoit getting the same result 

here is the string i want to generate a signature from json?h=riwaZCRx9wdmkZ6Mey1yRmkf

 

any help would be much appreciated 

Link to comment
Share on other sites

Hello. It's hard to know what you want to do without see more code. we don't know what  "sQ.encode" is and "Ea."  or the parameter passed. I'm almost sure It's possible but you need to share a code we can run for testing.

 

Saludos

Link to comment
Share on other sites

Hello. It's hard to know what you want to do without see more code. we don't know what  "sQ.encode" is and "Ea."  or the parameter passed. I'm almost sure It's possible but you need to share a code we can run for testing.

 

Saludos

Link to comment
Share on other sites

Hi thanks for your reply . and I see your point the data was scattered all around the site im working with . I dont understand how I was able to solve this but somehow I managed the code I ended up with looks like this , probably can be prettier but it works :)

 

Func _generateRequestPayloadSignature()
    ;testbelow
    global $User_Key = "0vj5guG531i-_hEBdPobPCq8"
    global $payload = '[{"__class__":"ServerRequest","requestData":[],"requestClass":"StartupService","requestMethod":"getData","requestId":1}]'
    global $data = $User_Key & "A3s8Y8368IWD+LhkP9atK/hZkfb0U2RarDNBZhGjh0gz0KQ8usvHyZkah2j4mcfTVaDEZVmuf2ZRoyt91a295g==" & $payload
    $signature = "this._hash" + "A3s8Y8368IWD+LhkP9atK/hZkfb0U2RarDNBZhGjh0gz0KQ8usvHyZkah2j4mcfTVaDEZVmuf2ZRoyt91a295g==" + "a"
    $signature = _Crypt_HashData($data, $CALG_MD5) ; Create a hash of the text entered.
    $signature = StringTrimLeft ($signature,2)
    $signature = StringTrimright($signature, StringLen($signature) - 10)
    $signature = StringLower($signature)
    ConsoleWrite($signature & @lf)
EndFunc
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...