Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to read magnetic cards?

Status
Not open for further replies.

hamed_sotoudi

Full Member level 3
Full Member level 3
Joined
Aug 1, 2007
Messages
156
Helped
15
Reputation
30
Reaction score
5
Trophy points
1,298
Location
Germany Hamburg
Activity points
2,195
Hi all
I want to know how we can read data from magnetic cards like ATM cards and how we can read some type of them which has a chip on them like telephone cards. thanks for your help.
 

What is the layout of data on magnetic stripe cards?
Data is laid out on a standard magnetic card in three tracks. A magnetic stripe card may have any of these tracks, or a combination of these tracks.

Track 1:
Track 1 was the first track standardized. It was developed by the International Air Transportation Association (IATA) and is still reserved for their use. It is 210bpi with room for 79 7-bit characters.
Track 1 is encoded with a 7-bit scheme (6 data bits plus one parity bit) that's based on ASCII. If your reader does not perform the ASCII conversion, all you have to do is add 0x20 to each byte to turn it into ASCII (there are no "control" characters). The seventh bit is an odd parity bit at the end of each byte.


Track 1 Fields:
Start sentinel: 1 byte (the % character)
Format code: 1 byte alpha (The standard for financial institutions specifies format code is "B")
Primary Account number: Up to 19 characters. American Express inserts space characters in here in the same places the digits are broken up on the face of your card.
Separator: 1 byte (the ^ character) [color]
Country code: 3 bytes, if used. (The United States is 840) This is only used if the account number begins with "59."
Surname: ---
Surname separator: (the / character)
First name or initial: ---
Space: (when followed by more data)
Middle name or initial: ---
Period: (when followed by a title)
Title: (when used)
Separator: 1 byte (^)
Expiration date or separator: 4 bytes (YYMM) or the one byte separator if a non-expiring card.
Discretionary data: Optional data can be encoded here by the issuer.
End Sentinel: 1 byte (the ? character)
Longitudinal Redundancy Check (LRC): 1 byte. The LRC is made up of parity bits for each "row" of bytes, making the total even. That means that the total of all the bit 1s of each byte has to come out to an even number. Same for bit 2, etc. The LRC's parity bit is not the sum of the parity bits of the message, but only the parity bit for the LRC character itself. (It's odd, just like any other single byte's parity bit.) [color]

Track 2:
Track 2 was developed by the American Bankers Association (ABA) for on-line financial transactions. It is 75bpi with room for 40 5-bit numeric characters.
Track 2 is encoded with a 5-bit scheme (4 data bits plus one parity bit.) To convert this data into ASCII, add 0x30 to each byte.


Track 2 Fields:
Start sentinel: 1 byte (0x0B, or a ; in ASCII)
Primary Account Number: Up to 19 bytes
Separator: 1 byte (0x0D, or an = in ASCII)
Country code: 3 bytes, if used. (The United States is 840) This is only used if the account number begins with "59."
Expiration date or separator: 4 bytes (YYMM) or the one byte separator if a non-expiring card
Discretionary data: Optional data can be encoded here by the issuer.
End Sentinel: 1 byte (0x0F, or a ? in ASCII)
Longitudinal Redundancy Check (LRC): 1 byte.

Track 3:
Track 3 is also used for financial transactions. The difference is its read/write ability. It is 210bpi with room for 107 numeric digits. Track 3 is used to store the enciphered PIN, country code, currency units, amount authorized, subsidiary account information, and other account restrictions.
Track 3 has the same properties as track 1 (start and end sentinels and an LRC byte), except that there is no standard for the data content or format. Track 3 is not currently used by any national bank card issuer.
In those rare systems where the PIN is stored on the card, this is the track where it is stored.


Additional Reading on Magnetic Cards:
For more information of this topic, read the ANSI/ISO 7811/1-5 standard. This document is available from the American Bankers Association.

Other standards documents covering related topics include:

ANSI X3.92 Data Encryption Algorithm (DEA)
ANSI X3.106 Modems of DEA Operation
ANSI X4.16 American National Standard for financial services, financial transaction cards, magnetic stripe encoding
ANSI X9.8 Personal Identification Number (PIN) Management and Security
ANSI X9.19 Financial Institution Retail Message Authentication (MAC)
ISO 7810
ISO 7811
ISO 7812
ISO 8583 Bank card originated messages; Interchange message specifications; Content for financial transactions.
ISO 8731-1 Banking: Approved algorithms for message authentication
Part 1 - DEA
Part 2 - Message Authentication algorithms

ISO 7816 Identification cards, Integrated circuit(s) with contacts

Part 1 - Physical Characteristics
Part 2 - Dimensions and locations of the contacts
Part 3 - Electronic signals and transmission protocols


For more information go to below mentioned links:
https://www.epanorama.net/documents/smartcard/magcard.html
https://en.wikipedia.org/wiki/Magnetic_stripe_card
 
Thanks for your help
and do you know any thing about the smart cards( the cards which has a chip on them)? how we can read data from them?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top