Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Device: Playbook developer
My Carrier: developer
Accepted Solution

SHA512 encoder.

Hello every one,

Problem regarding SHA512 encryption of the data in as3.0,But

Unfortunately i found with SHA256 in as3Crypto, Is there any library or class file for SHA512 convertion, Its very Urgent for me.

Thank you in advance.

Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: SHA512 encoder.

[ Edited ]

I personally never used it, but it looks like the flame library offers what you need. No idea about the performance though.

 

Hash algorithms: MD5, RIPEMD-160, SHA-1, SHA-2 (SHA-224, SHA-256, SHA-384, SHA-512) 
Keyed-hash algorithms: HMAC 
Symmetric algorithms: AES, Rijndael, RC4 
Asymmetric algorithms: RSA, Elliptic Curve Diffie-Hellman (ECDH)

Another idea would be to build a SHA-512 native extension (ANE).

 

Just out of curiosity, what requires you to use SHA-512?

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
Smugrik
Posts: 185
Registered: ‎04-05-2011
My Device: PlayBook
My Carrier: Bouygues Telecom

Re: SHA512 encoder.

hi @zezke, sorry for hogging the thread, but do you have an experience of how flame compares to as3crypto and a ANE when it comes to performance?
I'm having issues with as3crypto when hashing lots of data (several megabytes), and I'm currently looking to make an ANE for sha.
Thanks!
Julien
Web: smugrik.org Follow: @Smugrik
PlayBook apps:
OSCream
kiPass
Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: SHA512 encoder.

I think both flame and as3crypto will be limited by Adobe AIR itself. I am having a lot of performance issues as well with my unrar as3 port, so I will go for an ANE as well. Heavy as3 algorithms are also a bitch to keep the UI updated properly. 

 

I have no idea about the performance boost yet though, but I will definitely compare them and post back on it.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
Smugrik
Posts: 185
Registered: ‎04-05-2011
My Device: PlayBook
My Carrier: Bouygues Telecom

Re: SHA512 encoder.

Hi,

 

I have done a bit of testing so i can share the first (very promising) results about AS3 vs ANE sha hash:

 

I have coded an ANE for sha256, and ran a few test to compare ANE speed with as3crypto sha256 for different sizes of data, precision is very rough but significant enough.

 

for 85639 bytes (85 kB):

as3crypto: 2 seconds

ANE: 0 second

 

1949699 bytes (1.9 MB):

as3crypto: 44 seconds

ANE: 1 second

h

3084139 bytes (2.9 MB):

as3crypto: 70 seconds

ANE: 1 second

 

38441769 bytes (36.7 MB):

as3crypto:  883 seconds

ANE:  5 seconds

 

The results are clear

if your app is not performance sensible, for a few kB to hash, you could still go with as3crypto

but if you need high performance, or if your data is big, then ANE is the only choice: with 37 MB, ANE is 170 times faster than as3crypto.

 

Julien
Web: smugrik.org Follow: @Smugrik
PlayBook apps:
OSCream
kiPass
Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: SHA512 encoder.

Wow I did not expect this kind of results! Thank you Smugrik.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Device: Playbook developer
My Carrier: developer

SHA512 encoder.

Thank you for your response,

I have searched for that, But in the redirected page there are no files to download, Its just specifying that it consists SHA512  file.

So, can you please say me from where can I get the library.

Thank you in Advance.

Please use plain text.
Developer
Smugrik
Posts: 185
Registered: ‎04-05-2011
My Device: PlayBook
My Carrier: Bouygues Telecom

Re: SHA512 encoder.

Please use plain text.
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Device: Playbook developer
My Carrier: developer

SHA512 encoder.

Thankyou verymuch Smurgrik, Really great help, Now I found the SWC.

Actually in as3crypto we can encrypt using "sha256.hash(Data to encrypt)". But I am in  bit confusing with flame encryption, is there any sample, which explains how to use sha512 encryption.

I have read the docs which were with flame, but I could not understand from  that details. By the by I am new to this encryption so please don't mind in helping me.

Thank you in advance

Please use plain text.
Developer
Smugrik
Posts: 185
Registered: ‎04-05-2011
My Device: PlayBook
My Carrier: Bouygues Telecom

Re: SHA512 encoder.

This page has an exemple specifically for SHA512 http://code.google.com/p/flame/wiki/HashAlgorithms

Julien
Web: smugrik.org Follow: @Smugrik
PlayBook apps:
OSCream
kiPass
Please use plain text.