Hi,
I am trying to use the M0 command to encryt a pin block.
Here is my raw byte command sent to the hsm:
4D303030313130304232373441353632423730343234443343323734413536324237303432344433433030304630303030303030303030303030303030
Which is broken down as:
4D30 - M0
3030 - 00 (Mode Flag - 00 - ECB)
31 - 1 (Input format - 1N)
31 - 1 (Output format - 1N)
303042- 00B (Key type - DEK)
3237344135363242373034323444334332373441353632423730343234443343 - 274A562B70424D3C274A562B70424D3C (Key - 16H)
30303046 - 000F (Data length - 4H)
30303030303030303030303030303030 - 0000000000000000 (Data - 16H)
Here is the response from the HSM:
Raw response data: 4D313036
Response code: M1
Error code: 06 (Invalid Message length)
I am wondering why is it complaining about my message length which I think is ok. Please help with this.