views:

452

answers:

2

Hello everyone,

As mentioned by the title, I would like to find an implementation for HMAC-SHA-512 written for ActionScript. I was able to find a library that provide HMAC-SHA-256 with other functions, however, I am looking for HMAC-SHA-512 specifically.

Thank you

Edit:

Or, since actionscript and javascript have the same origin, can some one port this javascript version into actionscript?

http://pajhome.org.uk/crypt/md5/sha512.html

Edit 2:

I already ported the code from javascript to actionscript. The code can be found in one of the answers in this question Porting SHA-512 Javascript implementation to Actionscript

+1  A: 

The implementation you link to doesn't seem to be using any features that aren't supported by ActionScript 3. Just surround the whole thing with public class SHA512 { }, and prefix the first five functions with public.

Edit: You will also need to convert function int64 to it's own class (or possibly use Number, though I'm not sure if you will lose precision for 64-bit integers).

Richard Szalay
True, at the beginning, the modification seems easy. However, as I made Int64 as a class, modified the other functions to be part of it, and tried to adjust the other parts accordingly, the work didnt compile
What was the compilation error?
Richard Szalay
Thanks man, everything is fixed now and the code is working properly. I will post a link to the ported code in the question as an edit and accept your answer.
+1  A: 

Checkout this library: http://code.google.com/p/as3crypto/

Though only does: SHA-256,SHA-224,SHA-1,MD5, and MD2

So I guess that doesn't answer your question.

But best Crypto library for actionscript I've seen.

sobelito