Wednesday, November 15, 2017

What is LibSC Reader Kit?

What is LibSC Reader Kit

LibSC Card Reader Module Development Kit developed by JavaCardOS Technologies is based on Arduino MFRC522-1.2.0 library source code. It has been further encapsulated and its functions has also been enhanced as well, which makes it much closer to a universal card reader's function.
Combined with the card provided by JavaCardOS, you can directly send control commands from PC to communicate with the reader and then read/write the card infomation.It expands the new command control channel while retaining the original printout function, which greatly facilitates the 14443 communication protocol learning process.

Architecture

The content in the dotted box is the software code implementation on PC, such as all the scripts and LibSC API implementation.All these codes will be executed on PC.There are also two arrows,which indicate PORT A and PORT B. The PORT A is connected with USB cable.Although we just see an USB cable ,essentially,the USB device is virtual as a serial device to access to the computer.The PORT B indicates the dupont wires, which connnect arduino core board and MFRC522.The firmware code is downloaded to core board via USB, so you will see that the source code of this kit is divided to two directories, that is Client(PC-side code) and Firmware( firmware code that will be downloaded to arduino core board).

Features:
  • Read/Write card content by sending/receiving command via USB virtual serial port
  • Printout debug information via serial port(Serial.print)
  •  Support Arduino IDE 1.8.0
  • Read/write MIFARE card
  • Read/write 14443 type A CPU card
  •  Implement card UID clone operation by LibSC_Tools,a graphical interface open source tool.

List of Components

  • arduino UNO R3 board
  • MFRC522 antenna board
  • 1 * 8 Pin Header Strip(for MFRC522 board)
  • 1 * 8 Pin Header Strip(bending socket for MFRC522 board)
  • Dupont wire * 7
  • USB cable * 1
  • MIFARE 1k card

Download Source Code

      JavaCardOS
      Github
      Sourceforge

 Installation instructions and use the steps here for reference

Tuesday, June 6, 2017

Activate JCOP tools in Eclipse with a JCOP card

After you install the JCOP tool successfully, if you want to New a Java Card project, a dialog box called "JCOP Licensing Wizard" will pop up. Click "Next".


Select the second method " Check a JCOP Engineering Sample card" and click "Next"



Then place a JCOP card, such as J3D081 card, on the smartcard reader you are using, and select it from the dropdown list. Click "Finish"


The JCOP tool is activated successfully.





Thursday, May 18, 2017

How to install JCOP tool in Eclipse

This is a quick guide to install NXP JCOP plugin in Eclipse.  Next week, I will tell you how to activate JCOP tool with a commom JCOP card. Stay tuned. BTW, there is an Easter Egg at the end... → →

1. In Eclipse, click Help menu and select "Install New Software".


2. Then click Add button and select the installation program file. Click Next to install the tool.


 Easter Egg: If you want to know activate JCOP tool with a commom JCOP card now, please check this post.


Wednesday, May 3, 2017

Loyalty Card Solution

Loyalty Card is a kind of digital wallet, which is a popular marketing strategy in current commercial activities. It can encourage your customers to keep shopping at your businesses. It is mainly used in large chain stores, supermarkets, hotels, cinemas, KTV, high-level clubs and other consuming places.


 

Major function
Loyalty Card Demo includes Applet on card and outside card application. You can learn the detailed user guide here. The main functions are as belows:
  • Issue Card: Shopping malls, supermarkets and other consuming places will make specific initialization for the card before giving cards to their customers. Here are the main operations at this stage: download and install LoyaltyCardApplet into card and set password for the card.
  • Change PIN: Change password for the card.
  • Credit: Increase the card balance. You can transfer from your main bank account or deposit cash into the card. The money will be stored as digital currency for you to consume.
  • Purchase: After customers complete the payment via Loyalty card, deduct the amount from the balance and accumulate the corresponding points as well.
  • Get Balance: Check balance after consumption.
  • Get Points: Check accumulated points.
Source Code
To view the whole code, please visit JavaCardOS Forum


 1
 2
 3
 4
 5
 6
 7
 8  
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

/**
 * @file  LoyaltyCardApplet.java
 * @Loyalty Card Applet Sample Code
 * @copyright Copyright(C) 2016 JavaCardOS Technologies Co., Ltd. All rights reserved.
 * www.javacardos.com
 */
...
 public void process(APDU apdu) {
  // Good practice: Return 9000 on SELECT
  if (selectingApplet()) {
   return;
  }
  byte[] buf = apdu.getBuffer();
  
  if ((buf[ISO7816.OFFSET_CLA] == Loyalty_CLA) ||
         (buf[ISO7816.OFFSET_CLA] == ISO7816.CLA_ISO7816))
  {
      switch (buf[ISO7816.OFFSET_INS]) 
      {
    case INS_ISSUE_CARD:
     IssueCard(apdu);
     return;
          case INS_CREDIT:
           Credit(apdu);
           return;   
          case INS_VERIFY:
           Verify(apdu);
           return;           
          case INS_PURCHASE :
           Purchase(apdu);
           return;
          case INS_GET_BALANCE:
           GetBalance(apdu);
           return;           
          case INS_GET_POINTS:
           GetPoints(apdu);           
           return;
          case INS_GET_CARDID: 
              GetCardID(apdu);
              return;
    case INS_UPDATE_PIN:
     UpdatePin(apdu);
     return;
       case INS_GET_CHANNEL:
        GetChannel(apdu);
        return;
       case INS_EXTERNAL_AUTH:
     ExternalAuth(apdu);
        return;
       case INS_INTERNAL_AUTH:
        InternalAuth(apdu);
        return;     
       default:
        bRand = false;
        ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
      }
  } else {
   ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
  }
 }
 
 //In issue card process, there contains a PIN, key and the card ID
 private void IssueCard(APDU apdu)
 {
  ... 
 }
 
 ...