Square has been giving out credit card readers right and left, and its not hard to see why. Understanding how they work relies on an understanding of credit cards themselves. Every credit card has three basic parts of information. The first one has the name of the cardholder, the account number, the CVC code, and other data. The second one has just the credit card number as well as the expiration date. The third one is primarily empty.
A credit card reader like the one Square is giving away is primarily the head from a tape player as well as a microphone jack. The tape head reads the second track of information, and just moving that slightly can give you the information from the first one.
While it may be difficult to actually build one, it is possible and there are some tutorials online to help guide you if you want to build your own.