0

I'm trying to generate a base64 hash based on two inputs - a message and a key, both being strings, using HMAC SHA256. I've spent hours looking for answers and did come across a few sites or other posts on Stack Overflow, but unfortunately none seem to be what I need.

Is it possible to code a function myself on VBA? I'm using Mac so those CreateObject commands I saw elsewhere won't be available.

Here is what I found so far that I think could be relevant - hope it helps others who are trying to achieve the same using other languages or Windows.

https://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/#csharp

http://www.vbforums.com/showthread.php?635398-VB6-HMAC-SHA-256-HMAC-SHA-1-Using-Crypto-API

Let'sCode
  • 55
  • 10
  • Yes, it's possible. Have a look here for the SHA256: https://stackoverflow.com/questions/22672564/porting-sha-256-library-to-excel. – Florent B. Sep 19 '17 at 18:33
  • Thanks Florent, the concepts are very new to me so please correct me if I'm wrong. Just reading from this post https://security.stackexchange.com/questions/79577/whats-the-difference-between-hmac-sha256key-data-and-sha256key-data aren't the calculation methods for SHA256 and HMAC-SHA256 different? – Let'sCode Sep 19 '17 at 18:45
  • HMAC-SHA256 uses SHA256 to hash the key and message: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code – Florent B. Sep 19 '17 at 18:54

0 Answers0