Command pinpad.getpindukpt

Knowledge about DUKPT is required to use this command.

The command pinpad.getpindukpt captures a PIN and encrypts it using the standard DUKPT in the internal or external PIN-Pad, while displaying a message on the PIN-Pad or device display.


  1. maxlen [integer] Maximum number of characters typed in the PIN.
  2. message [string] Message that will be displayed on the external PIN-Pad's display (or internal in the case of a POS terminal).
  3. pan [string] Card primary account number.
  4. type [integer] Type of algorithm used in the encryption, which can be:
    • 0: DES
    • 1: 3DES
  5. variablereturnksn [string] Variable that will store the KSN returned by the encryption process.
  6. variablereturnpin [string] Variable that will store the encrypted PIN.
  7. variablereturn [integer] Variable that will store the return code, where:
    • 0: OK
    • -1: COMM Error
    • -2: Canceled
    • -3: PIN Error


In the example above, a connection is opened with the internal PIN-Pad using the command, and then the command pinpad.getpindukpt is executed.

The user is requested to type the PIN (password); the PIN is then encrypted and stored in the variable sEncriptedPIN, and the KSN is stored in the variable sKSN. Since the return value is an integer, the return is converted to stringvariable with the command inttostring

The PIN-Pad is disconnected using the command pinpad.close and then the values of the variables are displayed using the command display