Decrypting Code 39 barcodes by hand

For some time now, I have been searching the web to find info about barcodes.  Suddenly, I found a new challenge to accept.

Ever since I have dug up my old Cuecat I have been somewhat interested in barcodes.  However, decrypting barcodes by hand never crossed my mind until I wanted to log into a teacher's computer account at my high school.

On many days, I have computer work to do in study hall, yet, I don't want to use the computers provided by the school.  My study hall teacher, being extremely nice, lets me use the private computer in her office.  To get into the office, she gives me her keys to use, which also reluctantly includes her school ID.  Everyone in my school is issued one of these IDs, and everyone is given a specific ID #.  On student IDs, there is a barcode containing your ID number, and your ID # printed beneath that.

However, on teachers' IDs, there is only a barcode.  The obvious choice would be to bring the Cuecat to school and hook it up to her computer.  In an attempt to do this, I discovered that I needed to shutdown the computer first, or the keyboard would not respond.  Then a surprise; she has a BIOS password enabled!  Even though I could just take the internal battery out, if someone walked in when I was taking apart the computer, I would have basically no future ever using her computer again.

Another choice would be to take a picture of her ID, run it through a couple of sharpening/despeckling filters in Photoshop, and readjust the image proportions to make a perfectly square barcode that is printable.  Then I might be able to print the new image and scan it with my Cuecat.  A problem with this is that someone is bound to notice the camera flash going off (cameras are banned in my school.)

My final option that I discussed over and over in my head would to be to recreate the barcode by coping it with a good 'ol pad of graph paper and a Sharpie.  I learned that the barcode code used in all IDs of my school are in Code 39, which would be somewhat easily recreated. 

Code 39 is easy to recreate because it only uses two types of lines: wide and narrow.  Also, each code has a beginning sequence (thin black, wide white, thin black), and an ending sequence (thin black, wide white, thin black, thin white, wide black, thin white, wide black, thin white, thin black.)  To start the coping process, you need the following:

  • Sheet of graph paper
  • Writing utensil (pen is easier to see)
  • Bar/ASCII translating tool (look at Wikipedia article for a table, format 2)

To start, look at the barcode you want to decode.  On the graph paper, take record of the barcode using whatever means you feel comfortable with.  I use binary, as it is very easy to read.

After you transfer your barcode into binary, you can then figure out which letter corresponds to each combination of bars.  A wide black line is B, a thin black line is b, a wide white line is W, and a thin white line is w.  Make combinations of letters until you have your barcode.  Then all there is to do is find the corresponding letters/numbers and you have successfully decrypted a Code 39 barcode!


**BTW: I got a Saturday morning detention for "peeking" at my attendance records.  Please, do not use this information to gain access to anything you are not supposed to have access to.  THIS IS MY DISCLAIMER.