Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 MyKad Application, Need to capture data, how?

views
     
Gastinel
post Oct 14 2013, 07:28 AM

New Member
*
Newbie
1 posts

Joined: Oct 2013


[quote=cybpsych,Jun 4 2010, 10:06 AM]
is this the driver u got? v1.0.3.0

http://www.iris.com.my/index.cfm?sc=91

http://www.iris.com.my/_repository/iris/do...r_Installer.zip
*


Is it not illegal to capture and store data from MyKad unless you are a Government Agency? And what happens to this data afterwards? What protection from misuse do we have? Has no one heard of identity theft? No wonder you can find MyKads for sale if it is so easy for unauthorised persons to read the data.




blackamikaze
post Nov 25 2013, 04:05 PM

Trooper Rank: BIG HEAD SERGEANT
*******
Senior Member
2,638 posts

Joined: Jul 2005
From: Bestine, the capital of Tatooine



QUOTE(xenon @ Apr 13 2007, 10:15 AM)
A few forumers asked me questions regarding reading of MyKad surface information. The answer is there is no encryption; it is just about knowing what (APDU) command to send.

There will be 5 APDU commands that I'll introduce. I name them as
1) Select Application
2) Get Response
3) Set Length
4) Select Info
5) Read Info

Instead of viewing a particular command to read "Name", another command to read "IC no.", it is better to interpret a sequence of 3 commands (Set Length, Select Info, Read Info) as "reading a section (or the whole) file". The fact is "Name", "IC no." etc are stored in fixed-length fields (padded on the right), and concatenated together (without separator) to form files.
For example,
"Name" stored in file jpn-1-1, offset 0x00E9, length 0x28
"IC no." stored in file jpn-1-1, offset 0x0111, length 0x0D
When you want to read "Name", you read jpn-1-1, offset 0x00E9, length 0x28.
When you want to read "IC no.", you read jpn-1-1, offset 0x0111, length 0x0D.
When you want to read both "Name" and "IC no.", you read jpn-1-1, offset 0x00E9, length 0x35.
Conversely, you can read only part of the field; if you want only first 6 digits of "IC no.", read jpn-1-1, offset 0x111, length 6.

Now, the first 2 commands, "Select Application" and "Get Response", are used to select either one of JPN, JPJ, IMM appplication. (Actually you can have 2 active at the same time by using logical channels, but that's a little bit advanced at this stage.) You must select an application after reset, and you'll do it only once except you want to change application.

Reader: 00 A4 04 00 0A A0 00 00 00 74 4A 50 4E 00 10  (Send 10 bytes data, expect receive 0 bytes)
Card  : 61 05
Reader: 00 C0 00 00 05 (Send 0 bytes data, expect receive 5 bytes)
Card  : 6F 03 82 01 38 90 00

"00 A4 04 00 0A" is the "CLA INS P1 P2 P3" for "Select Application". The data part of the APDU consists of 10 bytes: "A0 00 00 00 74 4A 50 4E 00 10". The "A0 00 00 00 74" and "00 10" parts are constant. "4A 50 4E" represents "JPN". Change to "JPJ" or "IMM" for those applications.
"00 C0 00 00 05" is the "CLA INS P1 P2 P3" for "Get Response". The 5 data bytes received is not significant, but you can verify whether it is successful.

That's the end of description of "Select Application" and "Get Response". Now move on to the 3 commands to read a section of file.

Example: read jpn-1-1, offset 0x00E9, length 0x28.
Reader: C8 32 00 00 05 08 00 00 28 00
Card  : 91 08
Reader: CC 00 00 00 08 01 00 01 00 E9 00 28 00
Card  : 94 28
Reader: CC 06 00 00 28
Card  : 4D 59 20 4E 41 4D 45 20 20 20 20... 90 00

The 3 commands "Set Length", "Select Info", and "Read Info" are shown above. The colored parts are those which varies.
It seems from above that the maximum length will be 0xFF, so you'll have to break long file section (particularly when reading JPEG) into multiple reads (repeat the 3 commands with different length and offset). But actually, for advanced users, you can specify a length >= 0x0100, (provided you don't read past the end of file which results in no bytes returned,) in the "Set Length" and "Select Info". You only need multiple "Read Info", with the single byte length set to big a number (eg. 0xFF or 0xFC), except the last read. "Read Info" is just like retrieving out from a FIFO buffer, you can read however you want, but don't over-read it.

To read jpn-1-4, replace 01 00 01 00 to 04 00 01 00.

Those double byte "Offset" and "Length" are in little endian.

Tables
» Click to show Spoiler - click again to hide... «


» Click to show Spoiler - click again to hide... «


» Click to show Spoiler - click again to hide... «


Data types
» Click to show Spoiler - click again to hide... «

*
awesome, thanks for the table. Really help me alot on my project
blackamikaze
post Nov 25 2013, 04:05 PM

Trooper Rank: BIG HEAD SERGEANT
*******
Senior Member
2,638 posts

Joined: Jul 2005
From: Bestine, the capital of Tatooine



sorry, reposted

This post has been edited by blackamikaze: Nov 25 2013, 04:45 PM
mze0007
post Jun 14 2015, 07:10 PM

New Member
*
Newbie
3 posts

Joined: Jun 2015
Hi,
My name is Mubashir Hussain from Pakistan I'm IT student of IT in BMIC College maluri. Sir i want to submit my final assignment about ez100pu with vb 6.0 and access, last couple of week i searching the source code but fail, sir i have device but don't know more about connect this device with vb 6.0. Moreover, if your good office help me out i will pay you.
0129703973
mze0007@gmail.com


mze0007
post Jun 14 2015, 07:11 PM

New Member
*
Newbie
3 posts

Joined: Jun 2015
QUOTE(razinq @ Nov 3 2006, 04:44 PM)
Xenon ... good laa you ... ive download your program and it works with my rm50 reader  rclxms.gif Thanks alot ...
*
Hi,
My name is Mubashir Hussain from Pakistan I'm IT student of IT in BMIC College maluri. Sir i want to submit my final assignment about ez100pu with vb 6.0 and MS access, last couple of week i searching the source code but fail, sir i have device but don't know more about connect this device with vb 6.0. Moreover, if your good office help me out i will pay you.
0129703973
mze0007@gmail.com

This post has been edited by mze0007: Jun 14 2015, 07:12 PM
mze0007
post Jun 14 2015, 07:18 PM

New Member
*
Newbie
3 posts

Joined: Jun 2015
QUOTE(blackamikaze @ Nov 25 2013, 04:05 PM)
awesome, thanks for the table. Really help me alot on my project
*
Hi,
My name is Mubashir Hussain from Pakistan I'm IT student of IT in BMIC College maluri. Sir i want to submit my final assignment about ez100pu with vb 6.0 and MS access, last couple of week i searching the source code but fail, sir i have device but don't know more about connect this device with vb 6.0. Moreover, if your good office help me out i will pay you.
0129703973
mze0007@gmail.com

matkewl
post Oct 24 2018, 12:07 PM

Getting Started
**
Junior Member
114 posts

Joined: Dec 2008


Hi guys, do you have any recommendation on mycard reader where I need to read the IC number from the IC and pass that value to a web based CRM solution. Does the Mycard reader available with this function? Kindly help
johagood
post Oct 25 2018, 01:35 AM

New Member
*
Junior Member
44 posts

Joined: May 2007


QUOTE(matkewl @ Oct 24 2018, 12:07 PM)
Hi guys, do you have any recommendation on mycard reader where I need to read the IC number from the IC and pass that value to a web based CRM solution. Does the Mycard reader available with this function? Kindly help
*
hi,

All my kad reader with PCSC compliance are able to read MYKad. In order to pass the data to web based CRM, you need to create local services and submit the data when the reader successful read mykad.
machine07
post Feb 21 2019, 04:52 PM

New Member
*
Newbie
11 posts

Joined: Oct 2018
QUOTE(xenon @ Apr 13 2007, 10:15 AM)
A few forumers asked me questions regarding reading of MyKad surface information. The answer is there is no encryption; it is just about knowing what (APDU) command to send.

There will be 5 APDU commands that I'll introduce. I name them as
1) Select Application
2) Get Response
3) Set Length
4) Select Info
5) Read Info

Instead of viewing a particular command to read "Name", another command to read "IC no.", it is better to interpret a sequence of 3 commands (Set Length, Select Info, Read Info) as "reading a section (or the whole) file". The fact is "Name", "IC no." etc are stored in fixed-length fields (padded on the right), and concatenated together (without separator) to form files.
For example,
"Name" stored in file jpn-1-1, offset 0x00E9, length 0x28
"IC no." stored in file jpn-1-1, offset 0x0111, length 0x0D
When you want to read "Name", you read jpn-1-1, offset 0x00E9, length 0x28.
When you want to read "IC no.", you read jpn-1-1, offset 0x0111, length 0x0D.
When you want to read both "Name" and "IC no.", you read jpn-1-1, offset 0x00E9, length 0x35.
Conversely, you can read only part of the field; if you want only first 6 digits of "IC no.", read jpn-1-1, offset 0x111, length 6.

Now, the first 2 commands, "Select Application" and "Get Response", are used to select either one of JPN, JPJ, IMM appplication. (Actually you can have 2 active at the same time by using logical channels, but that's a little bit advanced at this stage.) You must select an application after reset, and you'll do it only once except you want to change application.

Reader: 00 A4 04 00 0A A0 00 00 00 74 4A 50 4E 00 10  (Send 10 bytes data, expect receive 0 bytes)
Card  : 61 05
Reader: 00 C0 00 00 05 (Send 0 bytes data, expect receive 5 bytes)
Card  : 6F 03 82 01 38 90 00

"00 A4 04 00 0A" is the "CLA INS P1 P2 P3" for "Select Application". The data part of the APDU consists of 10 bytes: "A0 00 00 00 74 4A 50 4E 00 10". The "A0 00 00 00 74" and "00 10" parts are constant. "4A 50 4E" represents "JPN". Change to "JPJ" or "IMM" for those applications.
"00 C0 00 00 05" is the "CLA INS P1 P2 P3" for "Get Response". The 5 data bytes received is not significant, but you can verify whether it is successful.

That's the end of description of "Select Application" and "Get Response". Now move on to the 3 commands to read a section of file.

Example: read jpn-1-1, offset 0x00E9, length 0x28.
Reader: C8 32 00 00 05 08 00 00 28 00
Card  : 91 08
Reader: CC 00 00 00 08 01 00 01 00 E9 00 28 00
Card  : 94 28
Reader: CC 06 00 00 28
Card  : 4D 59 20 4E 41 4D 45 20 20 20 20... 90 00

The 3 commands "Set Length", "Select Info", and "Read Info" are shown above. The colored parts are those which varies.
It seems from above that the maximum length will be 0xFF, so you'll have to break long file section (particularly when reading JPEG) into multiple reads (repeat the 3 commands with different length and offset). But actually, for advanced users, you can specify a length >= 0x0100, (provided you don't read past the end of file which results in no bytes returned,) in the "Set Length" and "Select Info". You only need multiple "Read Info", with the single byte length set to big a number (eg. 0xFF or 0xFC), except the last read. "Read Info" is just like retrieving out from a FIFO buffer, you can read however you want, but don't over-read it.

To read jpn-1-4, replace 01 00 01 00 to 04 00 01 00.

Those double byte "Offset" and "Length" are in little endian.

Tables
» Click to show Spoiler - click again to hide... «


» Click to show Spoiler - click again to hide... «


» Click to show Spoiler - click again to hide... «


Data types
» Click to show Spoiler - click again to hide... «

*
Awesome post helped my with my project too. I found an APDU list but sort of incomplete: https://www.eftlab.co.uk/index.php/site-map...u-response-list.

I am using ACR38u cost around RM50 for a project simply written in Java file below. The code is quite messy rclxub.gif because I am just a student tongue.gif


Attached File(s)
Attached File  JavaCardReader.java.txt ( 6.84k ) Number of downloads: 226
turnmoil
post Feb 22 2019, 11:01 AM

Casual
***
Junior Member
420 posts

Joined: Jan 2003
From: The Miau Miaw Niau Miow Land


QUOTE(mze0007 @ Jun 14 2015, 07:18 PM)
Hi,
My name is Mubashir Hussain from Pakistan I'm IT student of IT in BMIC College maluri. Sir i want to submit my final assignment about ez100pu with vb 6.0 and MS access, last couple of week i searching the source code but fail, sir i have device but don't know more about connect this device with vb 6.0. Moreover, if your good office help me out i will pay you.
0129703973
mze0007@gmail.com
*
u find alot of help here
www.fiverr.com

5 Pages « < 3 4 5Top
 

Change to:
| Lo-Fi Version
0.0155sec    0.52    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 07:04 PM