I am new to HSM Communication. Our company developing a credit card management solution. In this case I have to communicate with SafeNet Luna EFT HSM. So I have to generate CSC (Card Security Code) Value. In responding process HSM respond with 12 digit length Value. But CSC value can be 3,4 or 5 digit length. In safenet document they telling this " CSC Packed 5,4,3 digit CSC ". But always HSM will return 12 digit length CSC. So how can I do substring this? If you have an idea about this safenet hsm communication please help me.