OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Andrew Whitaker (andrewTTFN.NET)
Date: Fri Aug 31 2001 - 11:52:41 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    The command 80 4c is set lockable mode which you use either to lock and
    unlock your card or you set the personal code for the first time on a
    non-locking card
    The format of the command is as follows
     Cla 80
     ins 4C
     p1 00
     p2 00
     lc 05
     data 01 00 00 00 04
     le 00

    Where the first byte of data sets the card from non-locking to unlocked and
    next four bytes the code to set.
    If the card is already locked then you also use the first byte as 1 to
    unlock the card
    To lock the card you use a 2 in the first byte.

    If you want to change your personal code after first setting it for the
    first and only time on a non-locking card (a card can only be non-locking
    before a code has ever been set, the only way to turn a locked/unlocked card
    into a non-locking card is to use the reset personal code command and to use
    this you will need a pps card to obtain a signature) then you need to use
    change personal code which is used as follows:

     Cla 80
     ins 48
     p1 00
     p2 00
     lc 08
     data 00 00 00 00 01 01 01 01
     le 00

    where in this case 00 00 00 00 would be the old code and 01 01 01 01 would
    be the new code.

    Remember one thing though when you are setting codes such as 12345678 you
    may find that you get a SW12 which is 9e17 which is invalid personal code
    which means that simple codes are blocked as they are too simple to guess.

    hope this helps.

    Andrew

    --
    Andrew Whitaker
    mailto:andrewttfn.net
    www.ttfn.net
    

    -----Original Message----- From: Ana Lilian Becerra L. [mailto:abecerraBAENET.CL] Sent: 31 August 2001 17:33 To: SmartCardSDKDISCUSS.MICROSOFT.COM Subject: APDU and Visual basic (How I can setting a personal code .. )

    Hi!

    I try the send a comand aPDU with API ScardServer in visual Basic The command APDU is (Setting a personal code) my personal code in base decimal es 00000004 Cla 80 ins 4C p1 00 p2 00 lc 05 data 00 00 00 04 le 27

    in visual I send as:

    Dim InBuffer As String // memory space for our InBuffer Dim OutBuffer As String // memory space for our OutBuffer Dim InLen As Long Dim OutLen As Long InBuffer = Chr(&H80) + Chr(&H4C) + Chr(&H0) + Chr(&H0) + Chr(&H5) + Chr(&H1) + Chr(0) + Chr(0) + Chr(0) + Chr(4) InLen = Len(InBuffer) OutLen = 200 // = enough space for OutBuffer OutBuffer = String(OutLen, 0) // Initialize OutBuffer, get memory L = SCardComand(0, "Card,APDU", 0, InBuffer, InLen, OutBuffer, OutLen)

    its is correct ! :)

    but I whish setting code as 12345678 (leng = 8) I put InBuffer = Chr(&H80) + Chr(&H4C) + Chr(&H0) + Chr(&H0) + Chr(&H5) + Chr(&H1) + Chr(12) + Chr(34) + Chr(56) + Chr(78) but the code setting is it not 12345678 .. , when I check the personal code it response me as " wrong code"

    How I can setting a personal code of leng 8 in my smart card mondex ??

    you can help me.. ; ) thanks!