Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to generate SHA 256 encrypted code

user8769643Aug 18 2010 — edited Aug 22 2010
Hi all,

I need your great help in imlementing a SHA 256 generator in java. Basically if given an input string something like

“hn-Rw2ZH-YwllUYkklL5Zo_7lWJVkrbShZPb5CD1expires=4102448462&file_name=mario.avi&file_size=4000title=Mario”

I should be able to generate an SHA-256 digest in base 64 format on this string, truncate the string to 43 characters and drop any trailing '=' signs. URI encode the signature specifically '+','=', and '/'. This example should produce a encrypted code something like

dNNtzTAzsdfGrRFJlJsBe0tF4lTxjP2CM6G7AFqtdw4

I am not really sure how can i develop this generator in java. Can you please advise.

I really appreciate your help.

Thank You

Edited by: twisai on Aug 18, 2010 6:49 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2010
Added on Aug 18 2010
9 comments
2,810 views