of primitives (single row, concentric, stacked, …) - Symbol table (pixels → bits) - Encoding (bits → information) - Checksums and Error Correction Code - What the numbers mean (part numbers, ZIP codes, ...)
Bar Size: 4 Slots 106 Different Characters 3 Character Sets for “Full-Ascii” Code 128: Full ASCII, variable length, continuous (11,3), three character sets
2-width 12 slots 5 bars & 4 gaps per character Two distinct widths 3 out of 9 Bars or Gaps are 2x wide Variable Gap between characters 39 Different Characters: A-Z 0-9 *$/+%
Postal since 2009 00-300-123456-123456789-94143-3008-00 “Send First Class letter with no services (300) no OEL information (00) to UCSF Conference center (94143-3008-00) using mAILer ID 123456 and sequence number 123456789”
White in Top right means: Uses EC200 PyBay Left and bottom guards are solid Top and right guards are clocked P y B P y a B a REED-SOLOMON ERROR CORRECTION PADDING
596 bits, hexagonal elements Grid Matrix: optimized for encoding Chinese characters Code One: First non-proprietary 2D symbology (1992) Micro QR: Variation of QR Code, numeric, up to 35 digits, single alignment mark ← HIBC Datamatrix: Variation of Datamatrix, up to 36 characters, used in medical devices ←
continuous (7,2) 4-width Source: Businessweek, April 7, 1973. Available on the website of the ID History Museum at http://idhistory.com/ibm/Busweek1973001.pdf
Imaging Photos: “ACI plate on an IANR hopper” by Feddacheenee on Wikimedia Commons. https://commons.wikimedia.org/wiki/File:ACI_plate.jpg “Petrified Forest, Flora, Summer 2010” Quinn Rossi on flickr, Licensed under CC BY 2.0. https://www.flickr.com/photos/theeskimo/4898894840/
Imaging Photo: “Barcodelesestift mit Leseeinheit” by I,Nightflyer on Wikimedia.de under CC BY-SA 3.0 https://de.wikipedia.org/wiki/Barcodeleseger%C3%A4t#/media/File:Barcodelesestift.jpg
These can optimize every step of the process going from light to data. Photos: “Symbol Motorola” by Lost Parcels on flickr, licensed under CC BY 2.0, https://www.flickr.com/photos/lostparcels/31046764866/. By HP APJ on flickr, licensed under CC BY-NC-ND 2.0, https://www.flickr.com/photos/personalagain/5444387315/
With the Interleaved 2-of-5 symbology makes valid partial scans very likely, only use with fixed length content I AM A RED STICKER THAT BREAKS YOUR BARCODE “4321” “0987654321”
Google Chrome “crashes” when scanning a product code into a textbox Here’s why: - Product code is a GS1 Datamatrix code - GS1 Datamatrix specifies “FNC1” character as separator - Code 128 maps “FNC1” to 0x64 - My barcode reader decides to communicate 0x64 as F8 key - In Chrome developer tools “F8” means: Stop code execution
you can - Use a symbology that is right and safe for your data type - Configure your reader hardware - Limit the symbologies accepted to those you actually need - Disable reader configuration through barcodes - Validate input as if it was user input (because it is) - Validate that only the characters or numbers you expect are used - Check length of data (most symbologies are variable length) - Protect against Little Bobby Barcodes injection attacks - If your software hands out barcodes, treat them like browser cookies - Never include secrets in barcodes
http://jonasneubert.com/talks/pybay2018.html Want to work with me? https://www.zymergen.com/careers/ Watching this on Youtube? The best ways to reach me are Twitter (@jonemo) and email (jn@jonasneubert.com)
Guid To Reading, Printing, Specifying, Evaluating, And Using Bar Code and Other Machine-Readable Symbols, 5th ed., Trafford Pub. 2007 John Berry: The Secret Life of Bar Codes, Wirksworth Books, 2013 Gavin Weightman: Eureka: How Invention Happens, Yale University Press, 2017. Excerpt available at https://www.smithsonianmag.com/innovation/history-bar-code-180956704/ — I didn’t read the following but came across references to them during my research for this presentation: Ben Nelson: Punched Cards to Barcodes: A 200 Year Journey with Descriptions of over 260 Cods, Helmers Publishing, 1997. Stephen A. Brown: Revolution at the Checkout Counter: The Explosion of the Bar Code, Wertheim Publications in Industrial Relations, 1997. Bill Selmeier: Spreading the Barcode, Lulu.com, 2010. George J. Laurer: Engineering Was Fun, 3rd ed., Lulu.com, 2012.
Smith: Right Track, Wrong Station, Tedium. 2017. https://tedium.co/2017/09/05/kartrak-railroad-barcode-history/ Ernie Smith: Switching Labels, Tedium. 2017. https://tedium.co/2017/11/13/retail-theft-ticket-switching/ Ernie Smith: When Tech Hit Retail, Tedium. 2017. https://tedium.co/2017/07/20/point-of-sale-retail-history/ Larry Silverman: Barcodes, A Brief History, TrackAbout, 2015. https://corp.trackabout.com/barcodes-brief-history Brian Krebs: Why It’s Still A Bad Idea to Post or Trash Your Airline Boarding Pass, 2017. https://krebsonsecurity.com/2017/08/why-its-still-a-bad-idea-to-post-or-trash-your-airline-boarding-pass/ Jonas Neubert: Intro to Barcode Readers, 2017. http://jonemo.github.io/neubertify/2017/02/26/intro-to-barcode-readers/ Shaun Ewing: What’s contained in a boarding pass barcode, 2011. https://shaun.net/notes/whats-contained-in-a-boarding-pass-barcode/
TFO. https://www.youtube.com/watch?v=FXPSd5o0GeU (published to Youtube by OCR Canada Ltd.) “FX” Felix Lindner: Toying with Barcodes, DEFCON 16 (2008). https://www.youtube.com/watch?v=qT_gwl1drhc Karsten Nohl, Nemanja Nikodijevic: Where in the World Is Carmen San Diego, Becoming a Secret Travel Agent, 33c3 (2016). https://media.ccc.de/v/33c3-7964-where_in_the_world_is_carmen_sandiego Karina Ruzinov: Shipping secret messages through barcodes, PyCascades 2018. https://www.youtube.com/watch?v=01E5exVatGA
Norman J Woodland, Silver Bernard (Drexel University) Otolith Marking (Barcodes in Fish Bones) Volk, Schroder, Grimm, Ackley: Use Of A Bar Code Symbology to Produce Multiple Thermally Induced Otolith Marks, Transactions of the American Fisheries Society, vol. 123, is. 5, pp. 811-816 (1994). Volk, Schroder, Grimm: Otolith thermal marking, Fisheries Research, vol. 43, is. 1-3, pp. 205-219 (1999). Helmut Schraets: Meilensteine der Briefcodierung (1998). https://www.briefmarken-kevelaer.de/media/files/Meilensteine-Neu.pdf USPS: Intelligent Mail Barcode 4-state Specification (2015). https://ribbs.usps.gov/intelligentmail_mailpieces/documents/tech_guides/USPSB3200IntelligentMailBarco de4State.pdf DNA Bardcoding https://en.wikipedia.org/wiki/DNA_barcoding