November 2009
Sun Mon Tue Wed Thu Fri Sat
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          
Search

 
Catagories
Archives
Recent Entries
Links
RSS
card magnetic stripe?
Catagory: programming · This Entry · Comment(0) · eMail entry · Google
October 28, 2009 09:34 AM

programming

curiously enough, i discovered the magstripe on a credit card does not encode or obfuscate data (more than being a magnetic field with the equivalent of a bar code that is)... i just assumed it did. when you think about it, this is really the equivalent of peering at the front of the card --that's what you "see". i guess this makes sense. but i've also realized, card information is more vunerable than i hoped.

there are a number of well known, publish standards and specs.
this is the format i got scanning one of my cards:

;4111111111111111=1201=LAST/FIRST


More research yielded this info, and potential for encoding:

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 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 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 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

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:





Comments

Post a comment
Name:


Email Address:


URL:


Comments: