Click here to Skip to main content
15,898,980 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I've made a PHP Script and using HMAC_SHA224 and I want to convert it into VB>.Net, is there some who can help me. Please please. This is the codes I have.

What I have tried:

$password ="mypassword";
$salt = "c4a2bec3fba7ff27ff0a885be33a30efdbe94ee0ee9ca3a52c28a3560aafe88d";
$iter =1000;


$outputsha224 = base64_encode(hash_hmac("sha224", $password + $salt, $iter));
echo "SHA224 (".strlen($outputsha224).") String <br>".$outputsha224."";

OUTPUT: ZjMyN2ZmYTAwZGM2OGEyYTI5YTFiMzAwMTA4NmRmNWY5YWYwZTVlZjdhY2M4YzgzOTZiZGFjZDI= 
Posted
Updated 12-Apr-21 3:28am
v2
Comments
Richard Deeming 12-Apr-21 10:06am    
NB: According to the documentation, the third parameter to the hash_hmac function is a string containing the secret key:
PHP: hash_hmac - Manual[^]

You're passing in an integer which, from the name, you were expecting to be the number of hashing iterations used.

1 solution

There is no easy way to convert it directly. You should look at .NET cryptography model | Microsoft Docs[^] to see which classes and methods you need to implement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900