Card swipe Principle

Source: Internet
Author: User
Tags arabic numbers

The data records on the magnetic card are in accordance with is07811 standards, there are three magnetic channels. The data record density of a track is 210bpi. A maximum of 79 letters and numbers can be recorded. Each character is 7-bit encoded. A track is a read-only track. The data record density of a binary track is 75bpi. Up to 40 digits can be recorded. Each character is five-bit encoded, And the binary track is also a read-only track. The data record density of a three-track is 210bpi. A maximum of 107 numbers can be recorded. Each character is encoded by five digits. A three-track is a read/write track. It is used in the banking system. All bank stripe cards use two channels. You can choose to use a three-track. One-track is not used at the moment according to different bank regulations.
 
Take a two-track as an example. Each five BITs form a byte data. P1, C4, C3, C2, and C1 indicate the parity bit, while E1 and E4 indicate the data bit, A total of 16 characters are allowed. these characters contain 10 Arabic numbers and 6 other characters. The data on the track is logically reversed, that is, the data obtained on the track is 1, actually representing the logic 0. You can obtain the corresponding ASIC code by adding 0x30 to the lower four digits of the retrieved data. The track begins with some redundant data, followed by the starting position, followed by the data area, followed by the ending position. This is followed by LRC (vertical redundancy check bit), and the last is the redundant data zone. A maximum of 40 data records can be generated between the start and end flags of a binary track.

Redundant data zone: it does not contain valid data. It is only used for synchronization of track data. It is composed of several elements, and the inverse value is 0. Generally, during software decoding, the track is considered to have started only when redundant data with 5 consecutive bits (indicating logical 0) is detected.
Start flag: The data on the track is 101o0, and the value after the reverse is 01011. The value is 0x0b, and 0x30 is followed by the character ';'.
Data zone: contains the primary account, field separator, expiration date, service code, and additional data. The decoding method is the same as that of the Start flag. The end flag is oxlf. It is converted into an ASIC code as the character '? '.
LRC (vertical redundancy checkpoint): The variance or sum of characters on the track.
The direction of the swipe card may be forward or reverse. Therefore, when determining the valid value, the first 0 (inverse is 1) of the track is used as the marker, this is because the first valid bit of the Flag 0x0b or oxlf is 0 (the inverse is 1 ).

For forward card data processing, first, store the received data in a memory area, and judge when the first digit is 0 (reversed to 1) as the valid data, every five bits are retrieved as one byte of data. The first data is 0x0b, and oxlf within 40 bytes determines that forward data is successfully received.

There is a 50% chance of reverse swiping. For reverse swiping, data processing starts from the last bit of the data received on all tracks and forms a byte every five bits. When the first data value is 0 (the reverse value is logical 1), each 5 bits are decoded as one byte, the first data is 0xob and there is 0x1f In the 107 data. It is determined that the reverse data is successfully received. Then, the received data is converted into the corresponding ASIC code.

Card swipe Principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.