Skip to content
Advertisement

Converting a php cryptography and hash_hmac(‘sha512’ code to c#

I am having troubles converting a cryptography code from php to c#, and i would really appreciate some help, here is the php code

JavaScript

example data are the following:

JavaScript

what i did so far is

JavaScript

i am stuck in these two lines and i have no idea if i translate it them right

JavaScript

Advertisement

Answer

To compare both implementations, sample data is useful.

The following PHP code:

JavaScript

returns as result:

JavaScript

The C# implementation below gives the same result:

JavaScript

with

JavaScript

and

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement