Here is a magnetic card READER (not writer, or copier) that displays the content of the magnetic strip. This isn't as illegal as it may sound, especially considering that the information displayed is most of the times actually printed on the card itself.

The most common card readers have 5 basic signals coming from their PCB. Three datalines and two for power. Here they are:

Ribbon color Name Function Description
Brown RDP Read Data Pulse Normally HIGH, LOW when card is pulled through device
Red RCP Read Clock Pulse Generated when card is pulled through device, valid data is found in RDP pin at the falling edge of this clock signal
Orange CLS Card Loading Signal HIGH = 0, LOW = 1 (inverted logic)
Yellow +5V
Green Ground

Data stream Characters (numbers) from the card reader are sent in 5 bits [P,b4, b3, b2, b1] (parity and 4 data bits). They are sent in reverse order starting with b1. The bitstream starts with a start/token, and terminates with a stop/token or a separator

Ribbon color

Name LTP connector pin
Brown RDP 11
Red RCP 12
Orange CLS 13
Yellow +5V 2-9 (or external power source)
Green Ground 25

Note that you can *not* just solder pins 2-9 together, because that would most likely *damage* your printer port. Use 8 pieces of 1N4148 switch diodes connected like this:
The three 10k pull-up resistors are optional and are actually not used by me. The eight diodes are necessary to ensure you don't damage the parallel port. Pascal hardware access in different platforms: Windows: inpout32.dll Inp32, Out32 Linux: ioperm port[address]

DOS

MAGCARD.EXE / Extremely simple Pascal written program with souce code!, by Anonymous for interfacing this special kind of card reader. It expects data on the LPT (parallel port). I noticed problems getting the same circuit to work under Win XP. This has certainly something to do with the parallel port. Apparenlty Pascal programs cannot access the parallel port (or any other similar hardware) directly. Some sources suggest the call can be emulated by an interrupt used in Windows. Windows has different ways to access hardware devices on the 9x series and on the NT series. On the 9x series (95, 98, Me) programs can access the hardware directly, just like they did on DOS. The NT series (Windows NT and XP), however, don't allow this approach. On this architecture, all communication with hardware ports must be throught a device driver. So...I tried my luck with Linux...

LINUX

MGCARD / I made some minor adjustments to the the above Pascal source code and adapted it to Linux. If you haven't Free Pascal installed on your system execute the following commands, otherwise jump to step 5.
  1. sudo aptitude install alien
  2. wget http://mirror.mirimar.net/freepascal/dist/i386-linux-2.2.0/rpm/fpc-2.2.0-0.i386.rpm
  3. sudo alien -d fpc-2.2.0-0.i386.rpm
    This converts the rpm package into deb
  4. sudo dpkg -i fpc-2.2.0-0.i386.deb
    Now you are ready to compile the file
  5. fpc MAGCARD4.PAS
I included also the binary created for Ubuntu. Just about every card uses the following characters for the following reason:
Char Description
;start token
=separator
?end token, 1 checksum char follows

WIN

It would be interesting to adapt the code to VB or something preetier, but not necesserilly better ;)

Files

Pascal source code and binary for W32 pascal_winxp.rar
C source code & DLL for W32 inpout32_source_and_bins.zip
C source code for W32 c_winxp.rar
C source code for Linux c_linux.rar

Links

Check out www.freepascal.org