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

Post your completed addons to share with the community

Post » Wed Apr 18, 2012 2:27 am

Thanks - worked a treat!
B
18
S
3
Posts: 12
Reputation: 1,617

Post » Mon Jun 18, 2012 1:37 pm

@Kyatric - Nice work! Hey just out curiosity, have you ever dabbled with RC4 encryption? I've been trying to get it to work for ages, through the CallJS plugin, Rex's function plugin, and even having a go at writing a plugin myself. But the main problem is that the returned text uses some strange non standard character set.

For Example: 1C#!zz?J?      BS??y?hvA z[7Ψ?ܻ?

The same JS works in a standard webpage so I suspect C2 is doing something weird. Have you ever encountered anything strange like that?EyeHawk2012-06-18 13:38:26
B
34
S
8
G
3
Posts: 328
Reputation: 7,692

Post » Mon Jun 18, 2012 8:07 pm

@EyeHawk: Well I don't know RC4 even by name, and apparently, the MD5 and SHA- algorythms stand in the "defined" character set, so no problem with the encryption while I was working on them.

I guess it depends on how you include the algorythm in your plugin.
At worse, I'd advice to have an array containing the "character set" and work from there, though it might get pretty complicated.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Jun 19, 2012 6:03 am

@Kyatric - Ok thanks for the suggestion, I'll give it a try. I had a chat to a friend at work today, and he said that it looked like a binary string, so C2 is probably not encoding the output properly. I might also try looking for a binary string converter. Thanks!
B
34
S
8
G
3
Posts: 328
Reputation: 7,692

Post » Mon Jul 16, 2012 11:15 pm

Hey EyeHawk, I need to use RC4 as well for a project, because it's reversible encryption and there are versions for PHP and ActionScript which makes it very handy for cross platform games.
It would be great if you could add RC4 functionality to your plugin. I could send you the JS RC4 encrypt/decrypt functions.
The output is binary, which is a hassle if you need to use it in a URL for example, so what I normally do in PHP is use PHP's pack() and unpack() functions to convert it to hex
For example
unpack("H*0", rc4crypt::encrypt($password, $string));
returns something like
319d4323fed9d324436fc1d137884a92cc00aefc0eeccf0f01da95ee1b7087aac69c11250b7540a509b7705b3409c8b4178edbbce5
Which is a lot easier to use.
Then at the other end you'd use PHP's pack() function to return it to it's original form:
pack("H*", $encryptedstring);
I think there's a pack() function for JavaScript but no unpack() function. The source of PHP's unpack() function is available so it should be straightforward to convert to JS. So if you were to add RC4 encryption you could also add options to convert to and from hex.

Cheers

Lucas

B
16
S
1
Posts: 6
Reputation: 1,363

Post » Thu Oct 04, 2012 8:16 pm

Hi!

I cannot use plugin with C2 r103.2, cause I got errors when i want to do preview, and when i export, it doesnt work either.

I tried it in Chrome and in FF (same results).


See capx.





Kyatric can u fix it plz?Peteer2012-10-04 20:30:04
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Thu Oct 04, 2012 9:24 pm

@Peteer: Be sure to download and use the r70 compatible version from the first post of this thread.
I've just tested in r105 and with this version, the plugin works as expected.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Oct 05, 2012 4:54 am

@Kyatric: It`s working, thank you.
Firstly i downloaded it from your tutorial page, maybe u can update it there too.
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Fri Oct 05, 2012 5:16 am

Thanks, updated so that people come to the topic.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sun Jan 13, 2013 8:12 am

Excellent plugin! The MD5 functions work like a charm.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 4 guests