I want to convert a some code which is in Java to C#.
Java Code:
private static final byte[] SALT = \"NJui8*&N823bVvy03^4N\".getBytes(); public
The String.getBytes method encodes the string to bytes using the platform's default charset, whereas the example code you linked uses UTF-8.
Try this:
digest.update(secret.getBytes("UTF-8"));
Secondly, the Integer.toHexString method returns the hexadecimal result with no leading 0s.