This project is read-only.

Generate PIN Offset (IBM Method) for 6 digit PIN


Command: DE.
I want to generate the PIN offset (IBM Method) for a 6 digit PIN.
Thales Parameter: Clear PIN length set to 6 (this is so that program chop the DE request correctly)
Request: DE12234EA1333ADA20071446706049556490362734825909754861704N899999999
Exception occurs:
Searching for implementor of DE...
Found implementor ThalesSim.Core.HostCommands.BuildIn.GenerateIBMOffset_DE, instantiating...
Calling AcceptMessage()...
Calling ConstructResponse()...
Exception while processing message
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at ThalesSim.Core.Utility.SubtractNoBorrow(String str1, String str2)
at ThalesSim.Core.HostCommands.BuildIn.GenerateIBMOffset_DE.ConstructResponse()
at ThalesSim.Core.ThalesMain.WCMessageArrived(WorkerClient sender, Byte[]& b, Int32 len)
Disconnecting client.
Suspect that it is due to call in DE.ConstructResponse() below that hardcode the second parameter's length to 4 instead of following the length of the PIN:
        _offsetValue = Utility.SubtractNoBorrow(clearPin, _decimalisedAcctNum.Substring(0, 4)
Note: The command works fine when I tried with a 4-Digit PIN.
Would appreciate it very much if could help to provide a fix for it. Much thanks!!


dhirajm wrote Nov 28, 2016 at 2:42 PM

I am also getting the same issue.

Please let me know if this is resolved. And what is the solution.

In my Parameters.xml file Clear Pin length value is 4, and my encrypted pins under LMK are 6 digits long.