Cardorama: Magnetic Stripe Technology


SUBMITTED BY: Biohazard

DATE: Sept. 6, 2015, 2:32 a.m.

FORMAT: Text only

SIZE: 48.7 kB

HITS: 281

  1. From count0@spica.bu.edu Sat Jan 18 19:44:46 1992
  2. Received: from mrcnext.cso.uiuc.edu by ux1.cso.uiuc.edu with SMTP id AA13550
  3. (5.65d/IDA-1.4.4 for <khan@ux1.cso.uiuc.edu>); Sat, 18 Jan 1992 19:44:44 -0600
  4. Received: from spica.bu.edu by mrcnext.cso.uiuc.edu (NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0)
  5. id AA02279; Sat, 18 Jan 92 19:42:18 CST
  6. Received: by spica.bu.edu (5.61+++/Spike-2.1)
  7. id AA12820; Sat, 18 Jan 92 20:43:39 -0500
  8. Date: Sat, 18 Jan 92 20:43:39 -0500
  9. From: count0@spica.bu.edu (Bobby Newmark)
  10. Message-Id: <9201190143.AA12820@spica.bu.edu>
  11. To: khan@mrcnext.cso.uiuc.edu
  12. Subject: Re: Encoding Scheme of Mag Stripe Cards?
  13. *******************************************************************************
  14. * *
  15. * Card-O-Rama: Magnetic Stripe Technology and Beyond *
  16. * *
  17. * or *
  18. * *
  19. * "A Day in the Life of a Flux Reversal" *
  20. * *
  21. * *
  22. * *
  23. * by: ..oooOO Count Zero OOooo.. .RDT. 11/22/91 *
  24. * *
  25. *******************************************************************************
  26. ---A production of : -=Restricted -=Data -=Transmissions :
  27. : :
  28. : "Truth is cheap, but information costs." :
  29. Look in your wallet. Chances are you own at least 3 cards that have
  30. magnetic stripes on the back. ATM cards, credit cards, calling cards,
  31. frequent flyer cards, ID cards, passcards,...cards, cards, cards! And chances
  32. are you have NO idea what information is on those stripes or how they are
  33. encoded. This detailed document will enlighten you and hopefully spark your
  34. interest in this fascinating field. None of this info is 'illegal'...but
  35. MANY organizations (government, credit card companies, security firms,
  36. etc.) would rather keep you in the dark. Also, many people will IMMEDIATELY
  37. assume that you are a CRIMINAL if you merely "mention" that you are
  38. "interested in how magnetic stripe cards work." Watch yourself, ok? Just
  39. remember that there's nothing wrong with wanting to know how things work, altho
  40. in our present society, you may be labelled a "deviant" (or worse, a <gasp>
  41. "hacker!").
  42. Anyway, I will explain in detail how magstripes are encoded and give
  43. several examples of the data found on some common cards. I will also cover the
  44. technical theory behind magnetic encoding, and discuss magnetic encoding
  45. alternatives to magstripes (Wiegand, barium ferrite). Non-magnetic card
  46. technology (bar code, infrared, etc.) will be described. Finally, there will
  47. be an end discussion on security systems and the ramifications of emergent
  48. "smartcard" and biometric technologies.
  49. *DISCLAIMER*
  50. Use this info to EXPLORE, not to EXPLOIT. This text is presented for
  51. informational purposes only, and I cannot be held responsible for anything you
  52. do or any consequences thereof. I do not condone fraud, larceny, or any other
  53. criminal activities.
  54. *A WARNING*
  55. I've noticed lately a few "books" and "magazines" for sale that were
  56. FILLED with PHILES on a variety of computer topics. These philes were
  57. originally released into the Net with the intention of distributing them for
  58. FREE. HOWEVER, these philes are now being PACKAGED and sold FOR PROFIT. This
  59. really pisses me off. I am writing this to be SHARED for FREE, and I ask no
  60. payment. Feel free to reprint this in hardcopy format and sell it if you must,
  61. but NO PROFITS must be made. Not a fucking DIME! If ANYONE reprints this
  62. phile and tries to sell it FOR A PROFIT, I will hunt you down and make your
  63. life miserable. How? Use your imagination. The reality will be worse.
  64. ** MAGSTRIPE FIELDS, HEADS, ENCODING/READING **
  65. Whew! I'll get down to business now. First, I am going to explain the
  66. basics behind fields, heads, encoding and reading. Try and absorb the THEORY
  67. behind encoding/reading. This will help you greatly if you ever decide to
  68. build your own encoder/reader from scratch (more on that later).
  69. FERROMAGNETIC materials are substances that retain magnetism after an external
  70. magnetizing field is removed. This principle is the basis of ALL magnetic
  71. recording and playback. Magnetic POLES always occur in pairs within magnetized
  72. material, and MAGNETIC FLUX lines emerge from the NORTH pole and
  73. terminate at the SOUTH. The elemental parts of MAGSTRIPES are ferromagnetic
  74. particles about 20 millionths of an inch long, each of which acts like a tiny
  75. bar magnet. These particles are rigidly held together by a resin binder.
  76. The magnetic particles are made by companies which make coloring pigments
  77. for the paint industry, and are usually called pigments. When making the
  78. magstripe media, the elemental magnetic particles are aligned with their
  79. North-South axes parallel to the magnetic stripe by means of an external
  80. magnetic fields while the binder hardens.
  81. These particles are actually permanent bar magnets with TWO STABLE
  82. POLARITIES. If a magnetic particle is placed in a strong external magnetic
  83. field of the opposite polarity, it will FLIP its own polarity (North becomes
  84. South, South becomes North). The external magnetic field strength required to
  85. produce this flip is called the COERCIVE FORCE, or COERCIVITY of the particle.
  86. Magnetic pigments are available in a variety of coercivities (more on that
  87. lateron).
  88. An unencoded magstripe is actually a series of North-South magnetic
  89. domains (see Figure 1). The adjacent N-S fluxes merge, and the entire stripe
  90. acts as a single bar magnet with North and South poles at its ends.
  91. Figure 1: N-S.N-S.N-S.N-S.N-S.N-S.N-S.N-S <-particles in stripe
  92. ---------
  93. represented as-> N-----------------------------S
  94. However, if a S-S interface is created somewhere on the stripe, the fluxes
  95. will REPEL, and we get a concentration of flux lines around the S-S interface.
  96. (same with N-N interface) ENCODING consists of creating S-S and N-N
  97. interfaces, and READING consists of (you guessed it) detecting 'em. The S-S
  98. and N-N interfaces are called FLUX REVERSALS.
  99. ||| ||| <-flux lines
  100. Figure 2: N------------N-N-S-S-----------------S
  101. --------- flux lines -> ||| |||
  102. The external magnetic field used to flip the polarities is produced by a
  103. SOLENOID, which can REVERSE its polarity by reversing the direction of CURRENT.
  104. An ENCODING head solenoid looks like a bar magnet bent into the shape of a ring
  105. so that the North/South poles are very close and face each other across a tiny
  106. gap. The field of the solenoid is concentrated across this gap, and when
  107. elemental magnetic particles of the magstripe are exposed to this field, they
  108. polarize to the OPPOSITE (unlike poles attract). Movement of the stripe past
  109. the solenoid gap during which the polarity of the solenoid is REVERSED will
  110. produce a SINGLE flux reversal (see Figure 3). To erase a magstripe, the
  111. encoding head is held at a CONSTANT polarity and the ENTIRE stripe is moved
  112. past it. No flux reversals, no data.
  113. | | <----wires leading to solenoid
  114. | | (wrapped around ring)
  115. /-|-|-\
  116. / \
  117. Figure 3: | | <----solenoid (has JUST changed polarity)
  118. --------- \ /
  119. \ N S / <---gap in ring.. NS polarity across gap
  120. N----------------------SS-N-------------------------S
  121. ^^
  122. <<<<<-direction of stripe movement
  123. S-S flux reversal created at trailing edge of solenoid!
  124. So, we now know that flux reversals are only created the INSTANT the
  125. solenoid CHANGES its POLARITY. If the solenoid in Figure 3 were to remain at
  126. its current polarity, no further flux reversals would be created as the
  127. magstripe moves from right to left. But, if we were to change the solenoid
  128. gap polarity from NS to *SN*, then (you guessed it) a *N-N* flux reversal would
  129. instantly be created. Just remember, for each and every reversal in solenoid
  130. polarity, a single flux reversal is created (commit it to memory..impress your
  131. friends..be a tech weenie!). An encoded magstripe is therefore just a series
  132. of flux reversals (NN followed by SS followed by NN ...).
  133. DATA! DATA! DATA! That's what you want! How the hell are flux reversals
  134. read and interpreted as data? Another solenoid called a READ HEAD is used to
  135. detect these flux reversals. The read head operates on the principle of
  136. ELECTROMAGNETIC RECIPROCITY: current passing thru a solenoid produces a
  137. magnetic field at the gap, therefore, the presence of a magnetic field at the
  138. gap of a solenoid coil will *produce a current in the coil*! The strongest
  139. magnetic fields on a magstrip are at the points of flux reversals. These are
  140. detected as voltage peaks by the reader, with +/- voltages corresponding to
  141. NN/SS flux reversals (remember, flux reversals come in 2 flavors).
  142. See Figure 4.
  143. magstripe---> -------NN--------SS--------NN---------SS------
  144. Figure 4: voltage-----> .......+.........-.........+...........-.....
  145. ---------
  146. ---------- -------------
  147. peak readout--> | | | |
  148. --------| |----------| |----
  149. The 'peak readout' square waveform is critical. Notice that the voltage
  150. peak remains the same until a new flux reversal is encountered.
  151. Now, how can we encode DATA? The most common technique used is known as
  152. Aiken Biphase, or 'two-frequency coherent-phase encoding' (sounds impressive,
  153. eh?). First, digest the diagrams in Figure 5.
  154. Figure 5: ---------- ---------- ----------
  155. --------- | | | | | | <- peak
  156. a) | |--------| |--------| | readouts
  157. * 0 * 0 * 0 * 0 * 0 *
  158. ----- ----- ----- ----- ----- -
  159. | | | | | | | | | | |
  160. b) | |----| |----| |----| |----| |----|
  161. * 1 * 1 * 1 * 1 * 1 *
  162. ----- ---------- ----- ----- -
  163. | | | | | | | | |
  164. c) | |----| |--------| |----| |----|
  165. * 1 * 0 * 0 * 1 * 1 *
  166. There ya have it. Data is encoded in 'bit cells,' the frequency of which
  167. is the frequency of '0' signals. '1' signals are exacty TWICE the frequency
  168. of '0' signals. Therefore, while the actual frequency of the data passing
  169. the read head will vary due to swipe speed, data density, etc, the '1'
  170. frequency will ALWAYS be TWICE the '0' frequency. Figure 5C shows exactly how
  171. '1' and '0' data exists side by side.
  172. We're getting closer to read DATA! Now, we're all familiar with binary
  173. and how numbers and letters can be represented in binary fashion very easily.
  174. There are obviously an *infinite* number of possible standards, but thankfully
  175. the American National Standards Institute (ANSI) and the International
  176. Standards Organization (ISO) have chosen 2 standards. The first is
  177. ** ANSI/ISO BCD Data format **
  178. This is a 5-bit Binary Coded Decimal format. It uses a 16-character set,
  179. which uses 4 of the 5 available bits. The 5th bit is an ODD parity bit, which
  180. means there must be an odd number of 1's in the 5-bit character..the parity bit
  181. will 'force' the total to be odd. Also, the Least Significant Bits are read
  182. FIRST on the strip. See Figure 6.
  183. The sum of the 1's in each case is odd, thanks to the parity bit. If the
  184. read system adds up the 5 bits and gets an EVEN number, it flags the read
  185. as ERROR, and you gotta scan the card again. (yeah, I *know* a lot of you
  186. out there *already* understand parity, but I gotta cover all the bases...not
  187. everyone sleeps with their modem and can recite the entire AT command set
  188. at will, you know ;). See Figure 6 for details of ANSI/ISO BCD.
  189. Figure 6: ANSI/ISO BCD Data Format
  190. ---------
  191. * Remember that b1 (bit #1) is the LSB (least significant bit)!
  192. * The LSB is read FIRST!
  193. * Hexadecimal conversions of the Data Bits are given in parenthesis (xH).
  194. --Data Bits-- Parity
  195. b1 b2 b3 b4 b5 Character Function
  196. 0 0 0 0 1 0 (0H) Data
  197. 1 0 0 0 0 1 (1H) "
  198. 0 1 0 0 0 2 (2H) "
  199. 1 1 0 0 1 3 (3H) "
  200. 0 0 1 0 0 4 (4H) "
  201. 1 0 1 0 1 5 (5H) "
  202. 0 1 1 0 1 6 (6H) "
  203. 1 1 1 0 0 7 (7H) "
  204. 0 0 0 1 0 8 (8H) "
  205. 1 0 0 1 1 9 (9H) "
  206. 0 1 0 1 1 : (AH) Control
  207. 1 1 0 1 0 ; (BH) Start Sentinel
  208. 0 0 1 1 1 < (CH) Control
  209. 1 0 1 1 0 = (DH) Field Separator
  210. 0 1 1 1 0 > (EH) Control
  211. 1 1 1 1 1 ? (FH) End Sentinel
  212. ***** 16 Character 5-bit Set *****
  213. 10 Numeric Data Characters
  214. 3 Framing/Field Characters
  215. 3 Control Characters
  216. The magstripe begins with a string of Zero bit-cells to permit the
  217. self-clocking feature of biphase to "sync" and begin decoding.
  218. A "Start Sentinel" character then tells the reformatting process where to start
  219. grouping the decoded bitstream into groups of 5 bits each. At the end of the
  220. data, an "End Sentinel" is encountered, which is followed by an "Longitudinal
  221. Redundancy Check (LRC) character. The LRC is a parity check for the sums of
  222. all b1, b2, b3, and b4 data bits of all preceding characters. The LRC
  223. character will catch the remote error that could occur if an individual
  224. character had two compensating errors in its bit pattern (which would fool the
  225. 5th-bit parity check).
  226. The START SENTINEL, END SENTINEL, and LRC are collectively called "Framing
  227. Characters", and are discarded at the end of the reformatting process.
  228. ** ANSI/ISO ALPHA Data Format **
  229. Alphanumeric data can also be encoded on magstripes. The second ANSI/ISO
  230. data format is ALPHA (alphanumeric) and involves a 7-bit character set with
  231. 64 characters. As before, an odd parity bit is added to the required 6 data
  232. bits for each of the 64 characters. See Figure 7.
  233. Figure 7:
  234. --------- ANSI/ISO ALPHA Data Format
  235. * Remember that b1 (bit #1) is the LSB (least significant bit)!
  236. * The LSB is read FIRST!
  237. * Hexadecimal conversions of the Data Bits are given in parenthesis (xH).
  238. ------Data Bits------- Parity
  239. b1 b2 b3 b4 b5 b6 b7 Character Function
  240. 0 0 0 0 0 0 1 space (0H) Special
  241. 1 0 0 0 0 0 0 ! (1H) "
  242. 0 1 0 0 0 0 0 " (2H) "
  243. 1 1 0 0 0 0 1 # (3H) "
  244. 0 0 1 0 0 0 0 $ (4H) "
  245. 1 0 1 0 0 0 1 % (5H) Start Sentinel
  246. 0 1 1 0 0 0 1 & (6H) Special
  247. 1 1 1 0 0 0 0 ' (7H) "
  248. 0 0 0 1 0 0 0 ( (8H) "
  249. 1 0 0 1 0 0 1 ) (9H) "
  250. 0 1 0 1 0 0 1 * (AH) "
  251. 1 1 0 1 0 0 0 + (BH) "
  252. 0 0 1 1 0 0 1 , (CH) "
  253. 1 0 1 1 0 0 0 - (DH) "
  254. 0 1 1 1 0 0 0 . (EH) "
  255. 1 1 1 1 0 0 1 / (FH) "
  256. 0 0 0 0 1 0 0 0 (10H) Data (numeric)
  257. 1 0 0 0 1 0 1 1 (11H) "
  258. 0 1 0 0 1 0 1 2 (12H) "
  259. 1 1 0 0 1 0 0 3 (13H) "
  260. 0 0 1 0 1 0 1 4 (14H) "
  261. 1 0 1 0 1 0 0 5 (15H) "
  262. 0 1 1 0 1 0 0 6 (16H) "
  263. 1 1 1 0 1 0 1 7 (17H) "
  264. 0 0 0 1 1 0 1 8 (18H) "
  265. 1 0 0 1 1 0 0 9 (19H) "
  266. 0 1 0 1 1 0 0 : (1AH) Special
  267. 1 1 0 1 1 0 1 ; (1BH) "
  268. 0 0 1 1 1 0 0 < (1CH) "
  269. 1 0 1 1 1 0 1 = (1DH) "
  270. 0 1 1 1 1 0 1 > (1EH) "
  271. 1 1 1 1 1 0 0 ? (1FH) End Sentinel
  272. 0 0 0 0 0 1 0 @ (20H) Special
  273. 1 0 0 0 0 1 1 A (21H) Data (alpha)
  274. 0 1 0 0 0 1 1 B (22H) "
  275. 1 1 0 0 0 1 0 C (23H) "
  276. 0 0 1 0 0 1 1 D (24H) "
  277. 1 0 1 0 0 1 0 E (25H) "
  278. 0 1 1 0 0 1 0 F (26H) "
  279. 1 1 1 0 0 1 1 G (27H) "
  280. 0 0 0 1 0 1 1 H (28H) "
  281. 1 0 0 1 0 1 0 I (29H) "
  282. 0 1 0 1 0 1 0 J (2AH) "
  283. 1 1 0 1 0 1 1 K (2BH) "
  284. 0 0 1 1 0 1 0 L (2CH) "
  285. 1 0 1 1 0 1 1 M (2DH) "
  286. 0 1 1 1 0 1 1 N (2EH) "
  287. 1 1 1 1 0 1 0 O (2FH) "
  288. 0 0 0 0 1 1 1 P (30H) "
  289. 1 0 0 0 1 1 0 Q (31H) "
  290. 0 1 0 0 1 1 0 R (32H) "
  291. 1 1 0 0 1 1 1 S (33H) "
  292. 0 0 1 0 1 1 0 T (34H) "
  293. 1 0 1 0 1 1 1 U (35H) "
  294. 0 1 1 0 1 1 1 V (36H) "
  295. 1 1 1 0 1 1 0 W (37H) "
  296. 0 0 0 1 1 1 0 X (38H) "
  297. 1 0 0 1 1 1 1 Y (39H) "
  298. 0 1 0 1 1 1 1 Z (3AH) "
  299. 1 1 0 1 1 1 0 [ (3BH) Special
  300. 0 0 1 1 1 1 1 \ (3DH) Special
  301. 1 0 1 1 1 1 0 ] (3EH) Special
  302. 0 1 1 1 1 1 0 ^ (3FH) Field Separator
  303. 1 1 1 1 1 1 1 _ (40H) Special
  304. ***** 64 Character 7-bit Set *****
  305. * 43 Alphanumeric Data Characters
  306. * 3 Framing/Field Characters
  307. * 18 Control/Special Characters
  308. The two ANSI/ISO formats, ALPHA and BCD, allow a great variety of data to be
  309. stored on magstripes. Most cards with magstripes use these formats, but
  310. occasionally some do not. More about those lateron.
  311. ** Tracks and Encoding Protocols **
  312. Now we know how the data is stored. But WHERE is the data stored on the
  313. magstripe? ANSI/ISO standards define *3* Tracks, each of which is used for
  314. different purposes. These Tracks are defined only by their location on the
  315. magstripe, since the magstripe as a whole is magnetically homogeneous. See
  316. Figure 8.
  317. Figure 8:
  318. --------- <edge of card>
  319. _________________________________________________________________
  320. | ^ ^ ^
  321. |------------------| 0.223"--|---------|-------------------------
  322. | | | 0.353" | ^
  323. |..................|.........|.........| 0.493" |
  324. | Track #1 0.110" | | |
  325. |............................|.........|... <MAGSTRIPE>
  326. | | | |
  327. |............................|.........|... |
  328. | Track #2 0.110" | |
  329. |......................................|... |
  330. | | |
  331. |......................................|... |
  332. | Track #3 0.110" |
  333. |.......................................... |
  334. | |
  335. |------------------------------------------------------------------
  336. |
  337. | <body of card>
  338. |
  339. You can see the exact distances of each track from the edge of the card, as
  340. well as the uniform width and spacing. Place a magstripe card in front of you
  341. with the magstripe visible at the bottom of the card. Data is encoded from
  342. left to right (just like reading a book, eh?). See Figure 9.
  343. Figure 9:
  344. --------- ANSI/ISO Track 1,2,3 Standards
  345. Track Name Density Format Characters Function
  346. --------------------------------------------------------------------
  347. 1 IATA 210 bpi ALPHA 79 Read Name & Account
  348. 2 ABA 75 bpi BCD 40 Read Account
  349. 3 THRIFT 210 bpi BCD 107 Read Account &
  350. *Encode* Transaction
  351. *** Track 1 Layout: ***
  352. | SS | FC | PAN | Name | FS | Additional Data | ES | LRC |
  353. SS=Start Sentinel "%"
  354. FC=Format Code
  355. PAN=Primary Acct. # (19 digits max)
  356. FS=Field Separator "^"
  357. Name=26 alphanumeric characters max.
  358. Additional Data=Expiration Date, offset, encrypted PIN, etc.
  359. ES=End Sentinel "?"
  360. LRC=Longitudinal Redundancy Check
  361. *** Track 2 Layout: ***
  362. | SS | PAN | FS | Additional Data | ES | LRC |
  363. SS=Start Sentinel ";"
  364. PAN=Primary Acct. # (19 digits max)
  365. FS=Field Separator "="
  366. Additional Data=Expiration Date, offset, encrypted PIN, etc.
  367. ES=End Sentinel "?"
  368. LRC=Longitudinal Redundancy Check
  369. *** Track 3 Layout: ** Similar to tracks 1 and 2. Almost never used.
  370. Many different data standards used.
  371. Track 2, "American Banking Association," (ABA) is most commonly used. This
  372. is the track that is read by ATMs and credit card checkers. The ABA designed
  373. the specifications of this track and all world banks must abide by it. It
  374. contains the cardholder's account, encrypted PIN, plus other discretionary
  375. data.
  376. Track 1, named after the "International Air Transport Association," contains
  377. the cardholder's name as well as account and other discretionary data. This
  378. track is sometimes used by the airlines when securing reservations with a
  379. credit card; your name just "pops up" on their machine when they swipe your
  380. card!
  381. Since Track 1 can store MUCH more information, credit card companies are trying
  382. to urge retailers to buy card readers that read Track 1. The *problem* is that
  383. most card readers read either Track 1 or Track 2, but NOT BOTH! And the
  384. installed base of readers currently is biased towards Track 2. VISA USA is at
  385. the front of this 'exodus' to Track 1, to the point where they are offering
  386. Track 1 readers at reduced prices thru participating banks. A spokesperson for
  387. VISA commented:
  388. "We think that Track 1 represents more flexibility and the
  389. potential to deliver more information, and we intend to
  390. build new services around the increased information."
  391. What new services? We can only wait and see.
  392. Track 3 is unique. It was intended to have data read and WRITTEN on it.
  393. Cardholders would have account information UPDATED right on the magstripe.
  394. Unfortunately, Track 3 is pretty much an orphaned standard. Its *original*
  395. design was to control off-line ATM transactions, but since ATMs are now on-line
  396. ALL THE TIME, it's pretty much useless. Plus the fact that retailers and banks
  397. would have to install NEW card readers to read that track, and that costs $$.
  398. Encoding protocol specifies that each track must begin and end with a length
  399. of all Zero bits, called CLOCKING BITS. These are used to synch the self-
  400. clocking feature of biphase decoding. See Figure 10.
  401. Figure 10: end sentinel
  402. start sentinel | longitudinal redundancy check
  403. | | |
  404. 000000000000000 SS.................ES LRC 0000000000000000
  405. leading data, data, data trailing
  406. clocking bits clocking bits
  407. (length varies) (length varies)
  408. THAT'S IT!!! There you have the ANSI/ISO STANDARDS! Completely explained.
  409. Now, the bad news. NOT EVERY CARD USES IT! Credit cards and ATM cards will
  410. follow these standards. BUT, there are many other types of cards out there.
  411. Security passes, copy machine cards, ID badges, and EACH of them may use a
  412. PROPRIETARY density/format/track-location system. ANSI/ISO is REQUIRED for
  413. financial transaction cards used in the international interbank network. All
  414. other cards can play their own game.
  415. The good news. MOST other cards follow the standards, because it's EASY to
  416. follow a standard instead of WORKING to make your OWN! Most magstripe cards
  417. other than credit cards and ATM cards will use the same Track specifications,
  418. and use either BCD or ALPHA formats.
  419. ** A Bit About Magstripe Equipment **
  420. "Wow, now I know how to interpret all that data on magstripes! But...
  421. waitasec, what kind of equipment do I need to read the stripes?
  422. Where can I buy a reader? I don't see any in Radio Shack!!"
  423. Sorry, but magstripe equipment is hard to come by. For obvious reasons,
  424. card readers are not made commonly available to consumers. How to
  425. build one is the topic for another phile (and THIS phile is already too long!).
  426. Your best bets are to try and scope out Electronic Surplus Stores and flea
  427. markets. Don't even bother trying to buy one directly from a manufacturer,
  428. since they will immediately assume you have "criminal motives." And as for
  429. getting your hands on a magstripe ENCODER...well, good luck! Those rare
  430. beauties are worth their weight in gold. Keep your eyes open and look around,
  431. and MAYBE you'll get lucky! A bit of social engineering can go a LONG way.
  432. There are different kinds of magstripe readers/encoders. The most common
  433. ones are "swipe" machines: the type you have to physically slide the card thru.
  434. Others are "insertion" machines: like ATM machines they 'eat' your card, then
  435. regurgitate it after the transaction. Costs are in the thousands of dollars,
  436. but like I said, flea markets and surplus stores will often have GREAT deals
  437. on these things. Another problem is documentation for these machines. If you
  438. call the manufacturer and simply ask for 'em, they will probably deny you the
  439. literature. "Hey son, what are you doing with our model XYZ swipe reader? That
  440. belongs in the hands of a 'qualified' merchant or retailer, not some punk kid
  441. trying to 'find out how things work!" Again, some social engineering may be
  442. required. Tell 'em you're setting up a new business. Tell 'em you're working
  443. on a science project. Tell 'em anything that works!
  444. 2600 Magazine recently had a good article on how to build a machine that
  445. copies magstripe cards. Not much info on the actual data formats and encoding
  446. schemes, but the device described is a start. With some modifications, I bet
  447. you could route the output to a dumb terminal (or thru a null modem cable) in
  448. order to READ the data. Worth checking out the schematics.
  449. As for making your own cards, just paste a length of VCR, reel-to-reel, or
  450. audio cassette tape to a cut-out posterboard or plastic card. Works just as
  451. good as the real thing, and useful to experiment with if you have no expired or
  452. 'dead' ATM or calling cards lying around (SAVE them, don't TOSS them!).
  453. ** Examples of Data on Magstripes **
  454. The real fun in experimenting with magstripe technology is READING cards to
  455. find out WHAT THE HELL is ON them! Haven't you wondered? The following cards
  456. are the result of my own 'research'. Data such as specific account numbers and
  457. names has been changed to protect the innocent. None the cards used to make
  458. this list were stolen or acquired illegally.
  459. Notice that I make careful note of 'common data'; data that I noticed was
  460. the same for all cards of a particular type. This is highlighted below the
  461. data with asterisks (*). Where I found varying data, I indicate it with "x"'s.
  462. In those cases, NUMBER of CHARACTERS was consistent (the number of "x"'s equals
  463. the number of characters...one to one relationship).
  464. I still don't know what some of the data fields are for, but hopefully I
  465. will be following this phile with a sequel after I collect more data. It ISN'T
  466. easy to find lots of cards to examine. Ask your friends, family, and co-workers
  467. to help! "Hey, can I, um, like BORROW your MCI calling card tonite? I'm
  468. working on an, um, EXPERIMENT. Please?" Just...be honest! Also, do some
  469. trashing. People will often BEND expired cards in half, then throw them out.
  470. Simply bend 'em back into their normal shape, and they'll usually work (I've
  471. done it!). They may be expired, but they're not ERASED!
  472. -------------------------------------------------------------------------------
  473. -=Mastercard=- Number on front of card -> 1111 2222 3333 4444
  474. Expiration date -> 12/99
  475. Track 2 (BCD,75 bpi)-> ;1111222233334444=99121010000000000000?
  476. ***
  477. Track 1 (ALPHA,210 bpi)-> %B1111222233334444^PUBLIC/JOHN?
  478. *
  479. Note that the "101" was common to all MC cards checked, as well as the "B".
  480. -------------------------------------------------------------------------------
  481. -=VISA=- Number on front of card -> 1111 2222 3333 4444
  482. Expiration date -> 12/99
  483. Track 2 (BCD,75 bpi)-> ;1111222233334444=9912101xxxxxxxxxxxxx?
  484. ***
  485. Track 1 (ALPHA,210 bpi)-> %B1111222233334444^PUBLIC/JOHN^9912101xxxxxxxxxxxxx?
  486. *
  487. Note that the "101" was common to all VISA cards checked, as well as the "B".
  488. Also, the "xxx" indicates numeric data that varied from card to card, with no
  489. apparent pattern. I believe this is the encrypted pin for use when cardholders
  490. get 'cash advances' from ATMs. In every case, tho, I found *13* digits of the
  491. stuff.
  492. -------------------------------------------------------------------------------
  493. -=Discover=- Number on front of card -> 1111 2222 3333 4444
  494. Expiration date -> 12/99
  495. Track 2 (BCD,75 bpi)-> ;1111222233334444=991210100000?
  496. ********
  497. Track 1 (ALPHA,210 bpi)-> %B1111222233334444^PUBLIC/JOHN___^991210100000?
  498. ********
  499. Note, the "10100000" and "B" were common to most DISCOVER cards checked.
  500. I found a few that had "10110000" instead. Don't know the significance.
  501. Note the underscores after the name JOHN. I found consistently that the name
  502. data field had *26* charaters. Whatever was left of the field after the name
  503. was "padded" with SPACES. Soo...for all of you with names longer than 25
  504. (exclude the "/") charaters, PREPARE to be TRUNCATED! ;)
  505. -------------------------------------------------------------------------------
  506. -=US Sprint FON=- Number on front of card -> 111 222 3333 4444
  507. Track 2 (BCD,75 bpi)-> ;xxxxxx11122233339==xxx4444xxxxxxxxxx=?
  508. *
  509. Track 1 (ALPHA,210 bpi)-> %B^ /^^xxxxxxxxxxxxxxxxx?
  510. *
  511. Strange. None of the cards I check had names in the Track 1 fields. Track 1
  512. looks unused, yet it was always formatted with field separators. The "xxx"
  513. stuff varied from card to card, and I didn't see a pattern. I know it isn't
  514. a PIN, so it must be account data.
  515. -------------------------------------------------------------------------------
  516. -=Fleet Bank=- Number on front of card -> 111111 222 3333333
  517. Expiration date -> 12/99
  518. Track 2 (BCD,75 bpi)-> ;1111112223333333=9912120100000000xxxx?
  519. ****
  520. Track 1 (ALPHA,210 bpi) ->
  521. %B1111112223333333^PUBLIC/JOHN___^9912120100000000000000xxxx000000?
  522. * ****
  523. Note that the "xxx" data varied. This is the encrypted PIN offset. Always 4
  524. digits (hrmmm...). The "1201" was always the same. In fact, I tried many
  525. ATM cards from DIFFERENT BANKS...and they all had "1201".
  526. -------------------------------------------------------------------------------
  527. (Can't leave *this* one out ;)
  528. -=Radio Shack=- Number on front of card -> 1111 222 333333
  529. NO EXPIRATION data on card
  530. Track 2 (BCD,75 dpi)-> ;1111222333333=9912101?
  531. *******
  532. Note that the "9912101" was the SAME for EVERY Radio Shack card I saw. Looks
  533. like when they don't have 'real' data to put in the expiration date field, they
  534. have to stick SOMETHING in there.
  535. -------------------------------------------------------------------------------
  536. Well, that's all I'm going to put out right now. As you can see, the major
  537. types of cards (ATMs, CC) all follow the same rules more or less. I checked
  538. out a number of security passcards and timeclock entry cards..and they ALL had
  539. random stuff written to Track 2. Track 2 is by FAR the MOST utilized track on
  540. the card. And the format is pretty much always ANSI/ISO BCD. I *did* run
  541. into some hotel room access cards that, when scanned, were GARBLED. They most
  542. likely used a character set other than ASCII (if they were audio tones, my
  543. reader would have put out NOTHING...as opposed to GARBLED data). As you can
  544. see, one could write a BOOK listing different types of card data. I intended
  545. only to give you some examples. My research has been limited, but I tried to
  546. make logical conclusions based on the data I received.
  547. ** Cards of All Flavors **
  548. People wanted to store A LOT of data on plastic cards. And they wanted that
  549. data to be 'invisible' to cardholders. Here are the different card
  550. technologies that were invented and are available today.
  551. HOLLERITH - With this system, holes are punched in a plastic or paper card and
  552. read optically. One of the earliest technologies, it is now seen
  553. as an encoded room key in hotels. The technology is not secure,
  554. but cards are cheap to make.
  555. BAR CODE - The use of bar codes is limited. They are cheap, but there is
  556. virtually no security and the bar code strip can be easily damaged.
  557. INFRARED - Not in widespread use, cards are factory encoded by creating a
  558. "shadow pattern" within the card. The card is passed thru a swipe
  559. or insertion reader that uses an infrared scanner. Infrared card
  560. pricing is moderate to expensive, and encoding is pretty secure.
  561. Infrared scanners are optical and therefore vulnerable to
  562. contamination.
  563. PROXIMITY - Hands-free operation is the primary selling point of this card.
  564. Altho several different circuit designs are used, all proximity
  565. cards permit the transmission of a code simply by bringing the card
  566. near the reader (6-12"). These cards are quite thick, up to
  567. 0.15" (the ABA standard is 0.030"!).
  568. WIEGAND - Named after its inventor, this technology uses a series of small
  569. diameter wires that, when subjected to a changing magnetic field,
  570. induce a discrete voltage output in a sensing coil. Two rows of
  571. wires are embedded in a coded strip. When the wires move past
  572. the read head, a series of pulses is read and interpreted as binary
  573. code. This technology prodces card that are VERY hard to copy
  574. or alter, and cards are moderately expensive to make. Readers
  575. based on this tech are epoxy filled, making them immune to weather
  576. conditions, and neither card nor readers are affected by external
  577. magnetic fields (don't worry about leaving these cards on top of
  578. the television set...you can't hurt them!). Here's an example of
  579. the layout of the wires in a Wiegand strip:
  580. ||| || || | ||| | || || | || || | | ||
  581. | | | | | | |||| || |||| ||
  582. The wires are NOT visible from the outside of the card, but if
  583. your card is white, place it in front of a VERY bright light source
  584. and peer inside. Notice that the spacings between the wires is
  585. uniform.
  586. BARIUM FERRITE - The oldest magnetic encoding technology (been around for 40
  587. yrs!) it uses small bits of magnetized barium ferrite that are
  588. placed inside a plastic card. The polarity and location of
  589. the "spots" determines the coding. These cards have a short
  590. life cycle, and are used EXTENSIVELY in parking lots (high
  591. turnover rate, minimal security). Barium Ferrite cards are
  592. ONLY used with INSERTION readers.
  593. There you have the most commonly used cards. Magstripes are common because
  594. they are CHEAP and relatively secure.
  595. ** Magstripe Coercivity **
  596. Magstripes themselves come in different flavors. The COERCIVITY of the
  597. magnetic media must be specified. The coercivity is the magnetic field
  598. strength required to demagnetize an encoded stripe, and therefore determines
  599. the encode head field strength required to encode the stripe. A range of media
  600. coerciviteis are available ranging from 300 Oersteds to 4,000 Oe. That boils
  601. down to HIGH-ENERGY magstripes (4,000 Oe) and LOW-ENERGY magstripes (300 Oe).
  602. REMEMBER: since all magstripes have the same magnetic remanence regardless of
  603. their coercivity, readers CANNOT tell the difference between HIGH and LOW
  604. energy stripes. Both are read the same by the same machines.
  605. LOW-ENERGY media is most common. It is used on all financial cards, but its
  606. disadvantage is that it is subject to accidental demagnetization from contact
  607. with common magnets (refrigerator, TV magnetic fields, etc.). But these cards
  608. are kept safe in wallets and purses most of the time.
  609. HIGH-ENERGY meda is used for ID Badges and access control cards, which are
  610. commonly used in 'hostile' environments (worn on uniform, used in stockrooms).
  611. Normal magnets will not affect these cards, and low-energy encoders cannot
  612. write to them.
  613. ** Not All that Fluxes is Digital **
  614. Not all magstripe cards operate on a digital encoding method. SOME cards
  615. encode AUDIO TONES, as opposed to digital data. These cards are usually
  616. used with old, outdated, industrial-strength equipment where security is not an
  617. issue and not a great deal of data need be encoded on the card. Some subway
  618. passes are like this. They require only expiration data on the magstripe, and
  619. a short series of varying frequencies and durations are enough. Frequencies
  620. will vary with the speed of swiping, but RELATIVE frequencies will remain the
  621. same (for instance, tone 1 is twice the freq. of tone 2, and .5 the freq of
  622. tone 3, regardless of the original frequencies!). Grab an oscilliscope to
  623. visualize the tones, and listen to them on your stereo. I haven't experimented
  624. with these types of cards at all.
  625. ** Security and Smartcards **
  626. Many security systems utilize magstripe cards, in the form of passcards and
  627. ID cards. It's interesting, but I found in a NUMBER of cases that there was
  628. a serious FLAW in the security of the system. In these cases, there was a
  629. code number PRINTED on the card. When scanned, I found this number encoded on
  630. the magstripe. Problem was, the CODE NUMBER was ALL I found on the magstripe!
  631. Meaning, by just looking at the face of the card, I immediately knew exactly
  632. what was encoded on it. Ooops! Makes it pretty damn easy to just glance at
  633. Joe's card during lunch, then go home and pop out my OWN copy of Joe's access
  634. card! Fortunately, I found this flaw only in 'smaller' companies (sometimes
  635. even universities). Bigger companies seem to know better, and DON'T print
  636. ALL of the magstripe data right on card in big, easily legible numbers. At
  637. least the big companies *I* checked. ;)
  638. Other security blunders include passcard magstripes encoded ONLY with the
  639. owner's social security number (yeah, real difficult to find out a person's
  640. SS#...GREAT idea), and having passcards with only 3 or 4 digit codes.
  641. Smartcard technology involves the use of chips embedded in plastic cards,
  642. with pinouts that temporarily contact the card reader equipment. Obviously,
  643. a GREAT deal of data could be stored in this way, and unauthorized duplication
  644. would be very difficuly. Interestingly enough, not much effort is being put
  645. into smartcards by the major credit card companies. They feel that the tech
  646. is too expensive, and that still more data can be squeezed onto magstripe
  647. cards in the future (especially Track 1). I find this somewhat analagous to
  648. the use of metallic oxide disk media. Sure, it's not the greatest (compared
  649. to erasable-writable optical disks), but it's CHEAP..and we just keep improving
  650. it. Magstripes will be around for a long time to come. The media will be
  651. refined, and data density increased. But for conventional applications, the
  652. vast storage capabilities of smartcards are just not needed.
  653. ** Biometrics: Throw yer cards away! **
  654. I'd like to end with a mention of biometrics: the technology based on reading
  655. the physical attributes of an individual thru retina scanning, signature
  656. verification, voice verification, and other means. This was once limited to
  657. government use and to supersensitive installations. However, biometrics will
  658. soon acquire a larger market share in access control sales because much of its
  659. development stage has passed and costs will be within reach of more buyers.
  660. Eventually, we can expect biometrics to replace pretty much ALL cards..because
  661. all those plastic cards in your wallet are there JUST to help COMPANIES
  662. *identify* YOU. And with biometrics, they'll know you without having to read
  663. cards. I'm not paranoid, nor do I subscribe to any grand 'corporate
  664. conspiracy', but I find it a bit unsettling that our physical attributes will
  665. most likely someday be sitting in the cool, vast electronic databases of
  666. the CORPORATE world. Accessable by anyone willing to pay. Imagine CBI and TRW
  667. databases with your retina image, fingerprint, and voice pattern online for
  668. instant, convenient retrieval. Today, a person can CHOOSE NOT to own a credit
  669. card or a bank card...we can cut up our plastic ID cards! Without a card, a
  670. card reader is useless and cannot identify you. Paying in cash makes you
  671. invisible! However, with biometrics, all a machine has to do is watch...
  672. .listen...and record. With government/corporate America pushing all the
  673. buttons.. "Are you paying in cash?...thank you...please look into the camera.
  674. Oh, I see your name is Mr. Smith...uh, oh...my computer tells me you haven't
  675. paid your gas bill....afraid I'm going to have to keep this money and credit
  676. your gas account with it....do you have any more cash?...or would you rather
  677. I garnish your paycheck?" heh heh
  678. ** Closing Notes (FINALLY!!!!) **
  679. Whew...this was one MOTHER of a phile. I hope it was interesting, and I hope
  680. you distribute it to all you friends. This phile was a production of
  681. "Restricted Data Transmissions"...a group of techies based in the Boston area
  682. that feel that "Information is Power"...and we intend to release a number of
  683. highly technical yet entertaining philes in the coming year....LOOK FOR THEM!!
  684. Tomorrow I'm on my way to Xmascon '91.....we made some slick buttons
  685. commemorating the event...if you ever see one of them (green wreath..XMASCON
  686. 1991 printed on it)..hang on to it!...it's a collector's item.. (hahahah)
  687. Boy, I'm sleepy...
  688. Remember.... "Truth is cheap, but information costs!"
  689. But -=RDT is gonna change all that... ;) set the info FREE!
  690. Peace.
  691. ..oooOO Count Zero OOooo..
  692. Usual greets to Magic Man, Brian Oblivion, Omega, White Knight, and anyone
  693. else I ever bummed a cigarette off.....
  694. (1/18/92 addition: Greets to everyone I met at Xmascon..incuding but not
  695. excluding Crimson Death, Dispater, Sterling, Mackhammer, Erik Bloodaxe,
  696. Holistic Hacker, Pain Hertz, Swamp Ratte, G.A.Ellsworth, Phaedrus, Moebius,
  697. Lord MacDuff, Judge Dredd, and of course hats of to *Drunkfux* for organizing
  698. and taking responsibility for the whole damn thing. Hope to see all of you
  699. at Summercon '92! Look for Cyber-stripper GIFs at a BBS near you..heh heh)
  700. Comments, criticisms, and discussions about this phile are welcome. I can be
  701. reached at
  702. count0@world.std.com
  703. count0@spica.bu.edu
  704. count0@atdt.org
  705. Magic Man and I are the sysops of the BBS "ATDT"...located somewhere in
  706. Massachusetts. Great message bases, technical discussions...data made
  707. flesh...electronic underground.....our own Internet address (atdt.org)...
  708. .field trips to the tunnels under MIT in Cambridge.....give it a call..
  709. ..mail me for more info.. ;)
  710. ATDT------(???)YOU-WISH
  711. (You're not paranoid if they're REALLY out to get you... ;)

comments powered by Disqus