cbc-mac

ISO 9797-1 Algorithm 1 [CBC-MAC] in C#

It seems that there're 6 variations to CBC-MAC algorithm. I've been trying to match the MAC algorithm on the PINPad 1000SE [which per manual is ISO 9797-1 Algorithm 1]. I got an excellent start from here. And I coded the algorithm as below: public static byte[] CalculateMAC(this IPinPad pinpad, byte[] message, byte[] key) { //Div...

Using one key for Encryption and HMAC

Hello, I am wondering whether I can use a shared secret key established between two clients as the HMAC key too. I saw that there is a problem when it is used as a CBC-MAC but I haven't found any evidence it is bad practice for HMACs. Thanks, Vladimir ...