This is my first extension, so I’m sorry for any errors or bugs.
This is the tool:
It is very simple, however, I did dozens of tests with the three HMAC methods (SHA1, SHA256 and SHA512) and it worked perfectly.
Its inputs are Strings, and its output too: it is converted to a String in Hexadecimal format (I didn’t use Base64).
I looked for an extension that had these functions, but I couldn’t find it anywhere. So, I decided to create my own extension and now it’s there for everyone.
Please follow the naming conventions, which is UpperCamelCase for property, method and event names (i.e. the first letter should be a capital letter) and lowerCamelCase for parameter names, no underscores .
Also you might want to read this
to understand, that HMAC is not about encryption, it is hash based message authentication code, so your extension is not really an encryption tool… EDIT: I now updated the subject into “Hash Value tool extension” and I hope, you are ok with that…
Hashing vs. Encryption algorithms
There is a fundamental difference between Hashing and Encryption algorithms, see this stackoverflow answer: Hashing is one way. You can not get your data/string from a hash code. Encryption is 2 way - you can decrypt again the encrypted string if you have the key with you.