IBM Crypto Education Community

IBM Crypto Education Community

IBM Crypto Education Community

Join the IBM Crypto Education community to explore and understand IBM cryptography technology. This community is operated and maintained by the IBM Crypto Development team.

 View Only
  • 1.  Need help with ICSF CSNBSPN

    Posted Thu June 24, 2021 07:56 AM
    Hi All,

    I am using CSNBSPN to convert Encrypted ISO-0 pin block to ISO-2 pin block and encrypt new pin block with internal token (Type SECMSG;SMPIN) to create Encrypted Pin Block to send it in Pin Change EMV Script.

    I populated the below fields for CSNBSPN.
    rule_array - TDES-CBC;SELFENC
    input_PIN_block - ISO-0 pin block encrypted using pin encryption keys
    PIN_encrypting_key_identifier - DES IPINENC key
    input_PIN_profile - ISO-0    NONE     F
    input_PAN_data - 12 right most digit excluding check digit
    secmsg_key_identifier - DES key with control vector key type SECMSG with SMPIN
    output_PIN_profile - ISO-2    NONE     
    output_PAN_data - ignored

    CSNBPSN has the following fields and Direction mentioned as Input. But not sure what values to passed to the below fields.
    textLength
    Clear_text
    PIN_offset
    PIN_offset_field_length

    Please help.

    I think CSNBSPN call does the below.
    1. Decrypt the input_PIN_block using PIN_encrypting_key_identifier and place the output in Clear_text
    2. Convert Pin Block ISO-0 to Pin Block ISO-2 in Clear_text
    3. Encrypt the newly ISO-2 pin block in Clear_text using secmsg_key_identifier and return the result in enciphered_text.

    Please correct me if I am Wrong.

    Thanks,
    Sudharsan

    ------------------------------
    Sudharsan Srikanthan
    ------------------------------


  • 2.  RE: Need help with ICSF CSNBSPN

    Posted Fri June 25, 2021 02:01 PM
    Hi Sudharsan,
    textLength - Length of Clear_text (min len 8, max 4096; multiple of 8)
    Clear_text - any value, the output PIN_block will be placed within the clear_text
    PIN_offset - the offset within the clear text where the output PIN block will be placed. The PIN_offset plus PIN_offset_field_length must be less than or equal to the clear_text_length
    PIN_offset_field_length - must be 8

    Processing:
    Deciphers the input PIN block
    Reformats the PIN block when the input and output PIN-block formats differ
    Self-encrypts the output PIN block as specified
    Places the PIN block within the supplied text at the specified offset
    Encrypts the updated text.
    Returns the enciphered text

    Hope that helps,
    Sheri DeGroodt

    ------------------------------
    Sheri DeGroodt
    ------------------------------



  • 3.  RE: Need help with ICSF CSNBSPN

    Posted Tue June 29, 2021 04:56 AM
    Hi Sheri,

    Thanks a lot for the Reply. Now I understood the use of textLengh, ClearText, PIN_offset and PIN_offset_field_length.
    If want to add any more text with pin block to be enciphered then use ClearText and PIN_offset.

    If I use CLEARPIN instead of SELFENC in rule array, will the processing be like below. 
    Deciphers the input PIN block
    Reformats the PIN block when the input and output PIN-block formats differ
    Places the output PIN block within the supplied text at the specified offset
    Encrypts the updated text.
    Returns the enciphered text

    Thanks,
    Sudharsan


    ------------------------------
    Sudharsan Srikanthan
    ------------------------------



  • 4.  RE: Need help with ICSF CSNBSPN

    Posted Tue June 29, 2021 03:35 PM
    Hi Sudharsan - Yes, what you have documented is correct.

    Sheri DeGroodt

    ------------------------------
    Sheri DeGroodt
    ------------------------------



  • 5.  RE: Need help with ICSF CSNBSPN

    Posted Thu July 15, 2021 04:01 PM
    Hi Sheri,
     
    Thanks a lot for your valuable input. It worked. Able to decrypt the Pin block, change the pin block format and encipher with SMPIN key.

    The newly enciphered pin block is sent via scripts to EMV chip and it applied without any issues. 

    Thanks Again,
    Sudharsan Srikanthan


    ------------------------------
    Sudharsan Srikanthan
    ------------------------------