Resource icon

CARDPEEK 0.8 Reference Manual 2021-05-14

Table of Contents
Chapter 1 Presentation..............................................................................................................5
Chapter 2 Installation................................................................................................................7 2.1
Compiling and installing under Linux............................................................................7 2.2
Compiling and installing under Mac OS X....................................................................8 2.3
Installing under Windows..............................................................................................8 2.4
Related files and initial setup.........................................................................................8 2.4.1
Default installation..................................................................................................8 2.4.2
Changing the default installation directory............................................................9 2.5
Choosing a smart card reader.........................................................................................9
Chapter 3 Using Cardpeek.......................................................................................................11 3.1
Quick start.......................................................................................................................11 3.2
User interface.................................................................................................................12 3.2.1
Card view................................................................................................................12 3.2.2
The reader tab........................................................................................................13 3.2.3
The logs tab............................................................................................................14 3.2.4
The one-line command input field........................................................................14 3.3
Card-reader selection upon start-up.............................................................................14 3.4
Command line options..................................................................................................14
Chapter 4 Card analysis tools..................................................................................................16 4.1 Atr...................................................................................................................................16 4.1.1 Overview..................................................................................................................16 4.1.2
General notes..........................................................................................................17 4.2
Belgian eID.....................................................................................................................17 4.2.1 Overview.................................................................................................................17 4.2.2
General notes..........................................................................................................17 4.3 Calypso...........................................................................................................................17 4.3.1 Overview.................................................................................................................18 4.3.2
Implementation notes...........................................................................................18 4.4 emv.................................................................................................................................18 4.4.1 Overview.................................................................................................................18 4.4.2
Implementation notes...........................................................................................19 4.5 e-passport......................................................................................................................19 4.5.1 Overview.................................................................................................................19 4.5.2
Implementation notes............................................................................................19 4.6 GSM/SIM......................................................................................................................20 4.6.1 Overview.................................................................................................................20 4.6.2
General notes.........................................................................................................20 4.7 moneo............................................................................................................................20 4.7.1 Overview.................................................................................................................20 4.7.2
Implementation notes...........................................................................................20 4.8 OpenPGP.......................................................................................................................20 4.8.1 Overview................................................................................................................20 4.8.2
Implementation notes...........................................................................................20 2 4.9
Tachograph driver cards...............................................................................................20 4.9.1 Overview.................................................................................................................20 4.9.2
Implementation notes...........................................................................................20 4.10
vitale 2..........................................................................................................................21 4.10.1 Overview...............................................................................................................21 4.10.2 Notes.....................................................................................................................21 4.11
Adding your own scripts..............................................................................................21
Chapter 5
Programming Cardpeek scripts.............................................................................23 5.1 5.1
Hello world...............................................................................................................23 5.2
Basic communication with a smart card......................................................................24 5.3
Representing card data in a tree structure...................................................................26
Chapter 6 Development library..............................................................................................28 6.1
The bit library................................................................................................................28 6.1.1 bit.AND...................................................................................................................28 6.1.2 bit.OR.....................................................................................................................28 6.1.3 bit.XOR...................................................................................................................28 6.1.4 bit.SHL...................................................................................................................29 6.1.5 bit.SHR...................................................................................................................29 6.2
The bytes library...........................................................................................................29 6.2.1
Operators on bytestrings.......................................................................................30 6.2.2 bytes.clone.............................................................................................................30 6.2.3 bytes.concat...........................................................................................................30 6.2.4 bytes.convert..........................................................................................................31 6.2.5 bytes.format...........................................................................................................31 6.2.6 bytes.get.................................................................................................................32 6.2.7 bytes.ipairs.............................................................................................................33 6.2.8 bytes.is_printable..................................................................................................33 6.2.9 bytes.new...............................................................................................................33 6.2.10 bytes.new_from_chars........................................................................................34 6.2.11 bytes.pad_left.......................................................................................................34 6.2.12 bytes.pad_right....................................................................................................35 6.2.13 bytes.reverse.........................................................................................................35 6.2.14 bytes.set................................................................................................................35 6.2.15 bytes.sub...............................................................................................................36 6.2.16 bytes.tonumber....................................................................................................36 6.2.17 bytes.width...........................................................................................................36 6.3
The asn1 library.............................................................................................................37 6.3.1 asn1.enable_single_byte_length...........................................................................37 6.3.2 asn1.join.................................................................................................................38 6.3.3 asn1.split................................................................................................................38 6.3.4 asn1.split_length...................................................................................................38 6.3.5 asn1.split_tag.........................................................................................................39 6.4
The card library.............................................................................................................39 6.4.1 card.connect...........................................................................................................40 6.4.2 card.disconnect.....................................................................................................40 6.4.3 card.get_data.........................................................................................................40 3 6.4.4 card.info.................................................................................................................41 6.4.5 card.last_atr...........................................................................................................41 6.4.6 card.make_file_path.............................................................................................41 6.4.7 card.read_binary...................................................................................................43 6.4.8 card.read_record...................................................................................................43 6.4.9 card.select..............................................................................................................44 6.4.10 card.send..............................................................................................................45 6.4.11 card.warm_reset..................................................................................................45 6.5
The crypto library..........................................................................................................45 6.5.1 crypto.create_context............................................................................................45 6.5.2 crypto.decrypt........................................................................................................47 6.5.3 crypto.digest...........................................................................................................47 6.5.4 crypto.encrypt........................................................................................................47 6.5.5 crypto.mac.............................................................................................................48 6.6
The iconv library...........................................................................................................48 6.6.1 iconv.open..............................................................................................................48 6.6.2 iconv.iconv.............................................................................................................48 6.7
The nodes library..........................................................................................................49 6.7.1 nodes.append.........................................................................................................49 6.7.2 nodes.attributes.....................................................................................................50 6.7.3 nodes.children........................................................................................................51 6.7.4 nodes.find...............................................................................................................51 6.7.5 nodes.find_first......................................................................................................52 6.7.6 nodes.from_xml.....................................................................................................52 6.7.7 nodes.get_attribute................................................................................................52 6.7.8 nodes.parent..........................................................................................................53 6.7.9 nodes.remove.........................................................................................................53 6.7.10 nodes.root.............................................................................................................53 6.7.11 nodes.set_attribute...............................................................................................54 6.7.12 nodes.to_xml........................................................................................................54 6.8
The ui library.................................................................................................................55 6.8.1 ui.question..............................................................................................................55 6.8.2 ui.readline..............................................................................................................55 6.8.3 ui.load_view..........................................................................................................56 6.8.4 ui.save_view..........................................................................................................56 6.9
The log library...............................................................................................................56 6.9.1 log.print..................................................................................................................56 6.10
Other libraries..............................................................................................................57 6.10.1
The treeflex library...............................................................................................57 6.10.2
The country_codes and currency_codes libraries..............................................57 6.10.3
The en1545 library...............................................................................................57
Chapter 7 File format...............................................................................................................58
Chapter 8 License....................................................................................................................60
Author
Hacker
Downloads
331
Views
2,282
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Hacker

Top