NoCache

Table of Contents

Use USB Chip/Smart Card Reader on Arch Linux/Manjaro

Cyrus Kao
Last modified on .

PC/SC (Personal Computer/Smart Card) is not implemented by default on Arch-based Linux. To use your USB chip/smart card reader, we'll need some essential packages (drivers, tools, etc.) from the official repositories.

pcsc_scan
Screenshot of pcsc_scan when a card is inserted

Prerequisites

Install ccid (USB chip/smart card driver), opensc (smart card library) and pcsc-tools (utilities):

$ yay -S ccid opensc pcsc-tools

Don't know how to install packages on Arch based Linux? A full guide on Two Ways to Install Packages from AUR on Arch Linux/Manjaro.

Enable and start the pcscd service:

$ sudo systemctl enable --now pcscd

Check your Reader

Use pcsc_scan provided by pcsc-tools to scan your readers:

$ pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
0: CASTLES EZ100PU 00 00
Output
Thu Jan 27 15:13:57 2022
 Reader 0: CASTLES EZ100PU 00 00
  Event number: 0
  Card state: Card removed,
Output
Thu Jan 27 15:14:02 2022
 Reader 0: CASTLES EZ100PU 00 00
  Event number: 1
  Card state: Card inserted,
  ATR: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ATR: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ TS = 3B --> Direct Convention
+ T0 = F7, Y(1): 1111, K: 7 (historical bytes)
  TA(1) = 11 --> Fi=372, Di=1, 372 cycles/ETU
    10752 bits/s at 4 MHz, fMax for Fi = 5 MHz => 13440 bits/s
  TB(1) = 00 --> VPP is not electrically connected
  TC(1) = 00 --> Extra guard time: 0
  TD(1) = 81 --> Y(i+1) = 1000, Protocol T = 1
-----
  TD(2) = 71 --> Y(i+1) = 0111, Protocol T = 1
-----
  TA(3) = FE --> IFSC: 254
  TB(3) = 42 --> Block Waiting Integer: 4 - Character Waiting Integer: 2
  TC(3) = 00 --> Error detection code: LRC
+ Historical bytes: 00 00 00 00 00 00 00
  Category indicator byte: 00 (compact TLV data object)
    Tag: 6, len: 3 (pre-issuing data)
      Data: 00 00
    Mandatory status indicator (3 last bytes)
      LCS (life card cycle): 01 (Creation state)
      SW: 9000 (Normal processing.)
+ TCK = CC (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	ATM Card for Mega International Commercial Bank, Taiwan
	ATM card for HSBC Direct, Taiwan
	ATM card for TaChong Bank, Taiwan
	ATM card for Chunghwa Post, Taiwan
	VISA card for Taipei Fubon Bank, Taiwan
	ATM card for Cathay United Bank, Taiwan (Bank)
	https://www.cathaybk.com.tw/cathaybk/english/eindex.htm
Output

See Also

Comments

Sign in to leave a comment.