There are several security features common to credit cards. See here for further details of the security features of each specific credit card type (e.g. Visa, Mastercard, American Express, etc).
The magnetic stripe is located on the back of the credit card and contains encoded identifying information about the card’s account.
The encoded data is read when the credit card in swiped through a point-of-sale (POS) terminal. The data is displayed on the POS terminal’s screen and should match the information on the card itself—this information should be compared to verify the authenticity of the card.
The magnetic stripe is made up of minute iron-based magnetic particles—each about 8-millionths of a centimetre long—that can be magnetised in either a north or south pole direction. This creates the code in the magnetic stripe.
The magnetic stripe has three tracks that are encoded with different types of information:
The American National Standard for Financial Services—Financial Transaction Cards—Magnetic Stripe Encoding (ANSI X4.16) defines the characteristics of the magnetic stripe of the credit card. This includes the stripes’ physical, chemical and magnetic characteristics, such as its minimum and maximum size, and the location of the three encoded tracks. The contents of track 3 are defined by the American National Standard—Magnetic Stripe Data Content for Track 3 (ANSI X9.1).