Re: [81attendees] What is it at the bottom of restaurant receipts?

"Bill Ver Steeg (versteb)" <versteb@cisco.com> Tue, 09 August 2011 19:28 UTC

Return-Path: <versteb@cisco.com>
X-Original-To: 81attendees@ietfa.amsl.com
Delivered-To: 81attendees@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4F72F11E80F6 for <81attendees@ietfa.amsl.com>; Tue, 9 Aug 2011 12:28:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UxOibYzFsw1j for <81attendees@ietfa.amsl.com>; Tue, 9 Aug 2011 12:28:13 -0700 (PDT)
Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by ietfa.amsl.com (Postfix) with ESMTP id 8389811E80EC for <81attendees@ietf.org>; Tue, 9 Aug 2011 12:28:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=versteb@cisco.com; l=2847; q=dns/txt; s=iport; t=1312918123; x=1314127723; h=mime-version:content-transfer-encoding:subject:date: message-id:in-reply-to:references:from:to:cc; bh=ffvx2ndt++eWQBYhciiMAEj3FtZ8D2n8UNKrSozcWTI=; b=Qy7bbqHZNsqXDO7OhhSWgBW2yLZneENKiLg6MpK503qdh0lf4V9JlhJt ZqTx77iWYnN5IZVFh7Lfkue0678fYkymqx4pV0XmzpWTIoRX58Bju1tzH ODRXQlH7uWOqXuaiJ0EoVOPhI2StJuN//CV0HN3iQh2wFJvAUwjLugLLY c=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AuAAAEOJQU6tJV2a/2dsb2JhbABCl2CPXneBQAEBAQEDAQEBDwEdOAYLDAQCAQgRBAEBAQoGFwEGASYfCQgBAQQBEggah0+ebwGeYoVnXwSHLS+QO4t3
X-IronPort-AV: E=Sophos;i="4.67,345,1309737600"; d="scan'208";a="11447058"
Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by rcdn-iport-8.cisco.com with ESMTP; 09 Aug 2011 19:28:43 +0000
Received: from xbh-rcd-202.cisco.com (xbh-rcd-202.cisco.com [72.163.62.201]) by rcdn-core-3.cisco.com (8.14.3/8.14.3) with ESMTP id p79JSgJE005875; Tue, 9 Aug 2011 19:28:42 GMT
Received: from xmb-rcd-213.cisco.com ([72.163.62.220]) by xbh-rcd-202.cisco.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 9 Aug 2011 14:28:42 -0500
X-Mimeole: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Date: Tue, 09 Aug 2011 14:28:41 -0500
Message-ID: <EE933D92D054D14089A336CC71A5CCA6051EB8A6@XMB-RCD-213.cisco.com>
In-Reply-To: <CACB24MufX1Pb2PusTn1BquqMxiGUR_E7skz8rn_AiFAd6UBtOw@mail.gmail.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: [81attendees] What is it at the bottom of restaurant receipts?
Thread-Index: AcxWyDVjTLsMM5QdSyqa4jQ2X4WucgAAiMlA
References: <CD5674C3CD99574EBA7432465FC13C1B222B1F57D4@DC-US1MBEX4.global.avaya.com><CD5674C3CD99574EBA7432465FC13C1B222B1F5801@DC-US1MBEX4.global.avaya.com><9B3D0397-56CB-4270-9787-DCB67544D857@estacado.net><alpine.BSF.2.00.1108091333400.781@joyce.lan> <CACB24MufX1Pb2PusTn1BquqMxiGUR_E7skz8rn_AiFAd6UBtOw@mail.gmail.com>
From: "Bill Ver Steeg (versteb)" <versteb@cisco.com>
To: Richard Barnes <richard.barnes@gmail.com>, "John R. Levine" <johnl@iecc.com>
X-OriginalArrivalTime: 09 Aug 2011 19:28:42.0940 (UTC) FILETIME=[8C9D3FC0:01CC56CA]
Cc: 81attendees@ietf.org
Subject: Re: [81attendees] What is it at the bottom of restaurant receipts?
X-BeenThere: 81attendees@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF 81 Attendee List <81attendees.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/81attendees>, <mailto:81attendees-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/81attendees>
List-Post: <mailto:81attendees@ietf.org>
List-Help: <mailto:81attendees-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/81attendees>, <mailto:81attendees-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Aug 2011 19:28:14 -0000

The tax guy's worst nightmare - a bunch of techies in town for a conference trying to reverse engineer his enforcement tools. 

bvs


-----Original Message-----
From: 81attendees-bounces@ietf.org [mailto:81attendees-bounces@ietf.org] On Behalf Of Richard Barnes
Sent: Tuesday, August 09, 2011 3:12 PM
To: John R. Levine
Cc: 81attendees@ietf.org
Subject: Re: [81attendees] What is it at the bottom of restaurant receipts?

Not addressing the dingbats, but as far as the barcodes:

The barcodes are apparently in the ISO-standard PDF417 format:
<http://en.wikipedia.org/wiki/PDF417>

It appears you get meaningful data if you do the following:
1. Decode PDF417 as text
2. Base64-decode

Using that technique, I was able to match several fields from
different receipts:
-- MEV ID number (binary)
-- Transaction number ("FACTURE#"/"ADDITION#") (ASCII)
-- Table number (ASCII)
-- Server name (ASCII)
-- TPS amount (binary)
-- TVQ amount (binary)
-- Total amount (binary)

In all of the three cases I looked at, the first intelligible field
(the MEV ID) appears at position 0x40 in the binary.  This would be
consistent with the overall code having the form (digest, data), if
the digest were 512 bits long, say SHA512.  Chopping of the first 0x40
octets and hashing the remainder with SHA-512 did not give the right
hash values.   But then again, you wouldn't expect that if the hash
were an HMAC instead of just a digest; it would make a lot of sense
for the machine to compute the HMAC with a secret key that the tax
department knows.

FWIW,
--Richard



On Tue, Aug 9, 2011 at 1:35 PM, John R. Levine <johnl@iecc.com> wrote:
>> I asked a couple of waiters about them, and they had no idea what the
>> dingbats were for. That tells me that they don't use them for anything. They
>> use the barcodes for everything. That makes me wonder if the dingbats were
>> put there for restaurants that didn't invest in the bar-code system, as some
>> sort of alternative verification. Or maybe they're only used by auditors. Or
>> in expense reimbursement.
>
> I like the hash for audit theory.  It makes it harder to fake a receipt,
> which otherwise would be pretty easy if you're sending in scans of receipts,
> just load up gimp and cut and paste a few digits to adjust the amount.
>
> Regards,
> John Levine, johnl@iecc.com, Primary Perpetrator of "The Internet for
> Dummies",
> Please consider the environment before reading this e-mail. http://jl.ly
> _______________________________________________
> 81attendees mailing list
> 81attendees@ietf.org
> https://www.ietf.org/mailman/listinfo/81attendees
>
_______________________________________________
81attendees mailing list
81attendees@ietf.org
https://www.ietf.org/mailman/listinfo/81attendees