login about faq

Hi,

I need to be able to calculate the MAC for a specific text string using SHA256. Since I am new to this I am a bit lost.

Below is what I have done so far to specify the algorithm and set the key. How do I specify the string to run through the algorithm?

obj.SetHmacKeyString("mykey") obj.HashAlgorithm = "sha256"

Cheers, Marcus

asked Oct 24 '12 at 06:37

marcusmco's gravatar image

marcusmco
1111


I got it (VB.Net)!

    Dim obj As New Chilkat.Crypt2()
    Dim strMAC As String

    obj.UnlockComponent("Hello World")
    obj.SetHmacKeyEncoded(My.Resources.config.key, "hex")
    obj.HashAlgorithm = "sha256"
    obj.EncodingMode = "hex"
    strMAC = obj.HmacStringENC("00000000")
link

answered Oct 24 '12 at 07:05

marcusmco's gravatar image

marcusmco
1111

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×64

Asked: Oct 24 '12 at 06:37

Seen: 1,230 times

Last updated: Oct 24 '12 at 07:05

powered by OSQA