[Plugin]CB Hash (MD5, SHA-1 and SHA-256)

2 favourites
  • Thanks anyways. I figured it out. For some reason you can't change the same text in relative short order. As soon as I added a .25 second wait event between text changes it suddenly began showing them all. Again thanks for the help. :)

  • Just tried it with v152 of C2 and it still works perfectly :)

    Thank you very much Kyatric

    I've made some successful tests with this plugin sending hash results to php backend file through ajax plugin and comparing results between the hash generated by CBHash and the one generated by PHP functions.

    AWESOME.

    Thank you again.

  • Thank you

    Nice to know it is still working and useful <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I tried it with HMACSHA256B(nonce, appSecret), in which nonce is unique string responded from server and different every time, while appSecret is a constant.

    That function returns the same hash every time.

  • sntran: Are you sure the data "responded from server" is handled and used correctly in C2 ? (same data format (the expression expects a string/text), not trying to hash before having received the data, etc...) ?

  • : Yes, you are correct. I cleared out the hash before trying to access it. It generates correctly now.

    However, there is another issue I have with base64 pad. When I set it to "=", it actually sets it to "1" instead. Likewise, 0 for "". Is it intended?

    I modified your code to actually set to "=", but maybe my use case is different.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • sntran: I'm sorry, I don't understand what you mean by "When I set it to "=", it actually sets it to "1" instead. Likewise, 0 for ""."

    Keep in mind I've done the plugin and the example files more than 2 years ago.

    If you have a specific issue, please post a capx stating clearly what and where the issue is so that I can have a look into it.

  • Thank you for this KYATRIC. It's effective and simple enough even for me to understand!

  • Hi Kyatric, how can i md5 a ajax Request?

    Example: In C2 i submit some values with Ajax Request "http://game.com/score.php?name="& var1 &"&score="& var2 &"&key="&hash

    in the php file i compare the key and the md5 hash:

    $output_hash = md5($var1 . $var2 . $key); if output_has == $ hash { do something };

    I tried a few examples and tutorials, but i dont get it yet. I am not very savy with this algoritms to encode stuff.

    "" & CBHash.MD5("url") ?

    Thanks

  • lwgames: Your php code is requiring to md5 hash 3 concatenated elements.

    (The "." is the equivalent of "&" in Construct2 as far as string manipulation goes.)

    In your URL ends that would be "" & MD5(var1 & var2 & key)

    Where "var1", "var2" and "key" are Construct2 variables.

    If this doesn't work, try "" & MD5B(var1 & var2 & key) which is about the same but the output is BASE64 so a "secured"/encrypted URL.

    Here your issue is not with the algorithm but with the PHP I'd say.

  • lwgames: Your php code is requiring to md5 hash 3 concatenated elements.

    (The "." is the equivalent of "&" in Construct2 as far as string manipulation goes.)

    In your URL ends that would be "" & MD5(var1 & var2 & key)

    Where "var1", "var2" and "key" are Construct2 variables.

    If this doesn't work, try "" & MD5B(var1 & var2 & key) which is about the same but the output is BASE64 so a "secured"/encrypted URL.

    Here your issue is not with the algorithm but with the PHP I'd say.

    Thanks mate, this helps

  • Minor request, can you update this plug-in to include the below:

    http://caligatio.github.io/jsSHA/ ? SHA512 seems unlikely to ever be broken, at least compared to SHA256.

    I also request some basic scrypt implementation, basically:

    V(1) = hash(message)

    V(2) = hash(hash(message))

    ...

    and then the final hash is hash( V(1)+V(2)+...V(n) )

    This is a good plugin.

  • Nice work kyatric thanks

  • I just updated to the latest version of C2, and I also just downloaded the version of the MD5 Hash plugin that I found in the first post of this thread, and I'm getting no love. Is there a more recent version of the plugin I should be using?

  • Sestenes: Make sure to create a new folder in the "exporters\html5\plugins" folder, and not just copy the files at the root of the plugin folder.

    Otherwise, I've just tested in r184, the plugin is working as intended and still compatible with the current version.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)