# ANSI X9.9 Cryptography Standards

I'm trying to create a ISO8583 Rev93 message. What is the standard way of generating MAC key in ANSI X9.9
DES-CBC encryption algorithm is used to encrypt the message and generate the MAC.

• How many bytes should I take from the encrypted byte array based on ANSI X9.9 standard? 8 or 16? I think I should take 4 bytes (8 ASCII characters) and place them on field 128 (MAC). But very doubtful about that.

• The MAC key that the customer has provided me is 16 characters. (like 1234567890123456). Should I convert it to an 8 byte key? or a 16 byte key? (Based on ISO8583 Rev93 and ANSI X9.9)

Thank you.

-
 I suspect your best path forward is going to be reading the relevant standard, or hiring a consultant who knows the standard. Given that this is a non-public standard, I don't know whether anyone here is going to be able to answer your questions off the top of their head. – D.W. Sep 4 '11 at 4:20 I think the standard that the OP is referring to must be ISO 8583, second edition, 1993; perhaps with corrigenda 1 to the second edition, 1999. It is listed on the ISO site but is no longer for sale. – fgrieu Sep 4 '11 at 16:44

## 1 Answer

without doing your homework for you: did you check the open-source implementations of ISO 8583? is the answer somewhere in there?

Retrieved from wikipedia (strangely, the Spanish page, a good tip for finding more external references is changing the language tab)

-