N
N
Nikita Kolosov2011-06-12 08:32:14
Programming
Nikita Kolosov, 2011-06-12 08:32:14

Magnetic Stripe Cards - Encode/Decode

As far as I know, magnetic stripe cards use 3 tracks to store information.

Suppose there is a discount card of a certain discount system. Information about cardholders is stored on the system server. A partner connected to the system can find out information about the owner from the card.

Let's say we use only one track on the magnetic strip and store the card number there. And on the server there is a script that receives the card code and returns a response - information about the owner.

That is, everything depends on the software in the terminal? Well, it means that it is he who filters the data that the terminal recognizes, sends it to the server and receives a response?

Well, or, for security reasons, have something else like a PIN code, and store it on the second track.
And the script will receive 2 parameters - card number and pin

In any case, the main load lies on the software?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
J
JhaoDa, 2011-06-12
@Anexroid

If you want, you can ask me questions - I will try to answer.

M
mariofag, 2011-06-12
@mariofag

A magnetic card is only a carrier, what to store on it is your business and depends only on your specific desires and conditions.
If you want, you can store only the card number there, and get everything else from the server. If you want some data to be available instantly (for example, the name of the client and the expiration date of the card), save them on the card as well.
It is highly undesirable to store a PIN on the card, but if you really want to, you can store its hash. But remember that all information on magnetic stripe cards can be read and copied.

N
NikoB, 2011-06-12
@NikoB

www.atol.ru/auto-sys/articles/articles_9.html - at the very bottom there are some useful things.
retail.iqbuy.ru/pages/schityvatel-magnitnyh-kart - about magnetic card readers
Info by tracks:
1-track - alphanumeric information: up to 76 characters QWERTYUIOPASDFGHJKLZXCVBNM1234567890:; = + ( ) - ' - (key ' ' E)! @ # ^ & * < > / \ All Latin letters are CAPITAL.
The information will be surrounded by service characters:
" % " at the beginning of the line, " ? " at the end of the line
Service character '?' is added at the end of each row in the database and indicates the end of the magnetic stripe record and is not displayed when reading.
— only digits: 1234567890 and '=' sign, up to 37 characters space is displayed on the magnetic strip with '=' sign, '?' sign means the end of the recording on the magnetic stripe and is not displayed when reading.
The information will be surrounded by service characters:
" ; " at the beginning of the line, " ? " at the end of the line
3-track - only numbers: 1234567890 and the '=' sign, up to 104 character spaces a space is displayed on the magnetic tape with the '=' sign, the '?' sign means the end of recording on a magnetic card and is not displayed when reading.
The information will be surrounded by service characters:
" _ " at the beginning of the line, " ? " at the end of the line
And the software is different, according to your needs. There is support for reading cards in 1C, there is in terminals for waiters (I don’t remember what the program is called there).

B
benipaz, 2011-06-12
@benipaz

what is the actual question?
The pin is not stored on the card. the data from the track and the pin code are transmitted to the server, and there the user is already identified.

B
benipaz, 2011-06-12
@benipaz

without a pin. only on the track. therefore, if your card is stolen, you can immediately use it until you cancel it. For this, there is an insurance company that should return the money to you in this case.

N
NikoB, 2011-06-12
@NikoB

Reader and software are different things. You can buy any reader and use any software you want, in each program the procedure, and indeed, the principle of operation is different.

K
kartoha, 2012-08-07
@kartoha

What about bank cards? I heard the number they also store not encrypted, but in sound ... They convert the sound according to a special algorithm into numbers - the card number. Does anyone know anything about this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question