[Dcrup] Hashed Key Records

Scott Kitterman <sklist@kitterman.com> Thu, 22 June 2017 23:17 UTC

Return-Path: <sklist@kitterman.com>
X-Original-To: dcrup@ietfa.amsl.com
Delivered-To: dcrup@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AD22D127867 for <dcrup@ietfa.amsl.com>; Thu, 22 Jun 2017 16:17:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.002
X-Spam-Level:
X-Spam-Status: No, score=-2.002 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=kitterman.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Y7phTB0lggR for <dcrup@ietfa.amsl.com>; Thu, 22 Jun 2017 16:17:17 -0700 (PDT)
Received: from mailout03.controlledmail.com (mailout03.controlledmail.com [208.43.65.50]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A8820127369 for <dcrup@ietf.org>; Thu, 22 Jun 2017 16:17:17 -0700 (PDT)
Received: from kitterma-e6430.localnet (static-72-81-252-22.bltmmd.fios.verizon.net [72.81.252.22]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout03.controlledmail.com (Postfix) with ESMTPSA id B0B84C400E6 for <dcrup@ietf.org>; Thu, 22 Jun 2017 18:17:14 -0500 (CDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kitterman.com; s=201409; t=1498173434; bh=wSWF/V1ayDyR/CAL6v8GpjrJ79sx5BWyELUXPcrKaNQ=; h=From:To:Subject:Date:From; b=ZsxonbJK38HKo7tDqIEN4gsFaNxtpMcoaQoy1VlyCtyoj1VG8esPoO7dP14xepSXO aSd6YMLVr3+UBFPdZH2Q97zwzQmteOBBaCBfeqTh+z0Jv3Zhf539iAiK/6d2Lr8LTZ eWoz5ccGcXSFeEwrD6IKL7S/WzR0wnbUBCRmAoF8=
From: Scott Kitterman <sklist@kitterman.com>
To: dcrup@ietf.org
Date: Thu, 22 Jun 2017 19:17:13 -0400
Message-ID: <2793611.63lxTaCm4r@kitterma-e6430>
User-Agent: KMail/4.13.3 (Linux/3.13.0-119-generic; KDE/4.13.3; x86_64; ; )
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dcrup/UN7Up5Xpk7RaGGDFfyCCWEeZlA0>
Subject: [Dcrup] Hashed Key Records
X-BeenThere: dcrup@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: DKIM Crypto Update <dcrup.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dcrup>, <mailto:dcrup-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dcrup/>
List-Post: <mailto:dcrup@ietf.org>
List-Help: <mailto:dcrup-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dcrup>, <mailto:dcrup-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Jun 2017 23:17:19 -0000

It seemed like the hashed RSA variant ought to be easy enough to implement, so 
I decided to give it a go.  I almost immediately ran into a question.  For 
terminology, I'm using what openssl says [1]

I am assuming that "SHA-256 hash of the public key, stored in base64" means 
use the output of the digest in binary form (--binary) option and encode it in 
base 64.  Is that correct?


So if my signing key were (I know, but just to make sure I understand the 
tranformations):

'Hello World'

Then the the p tag in DNS would be:

p=pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4=

Am I understanding it correctly?

A python one liner:

>>> base64.b64encode(hashlib.sha256(b'Hello World').digest())
'pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4='

Scott K



[1] https://www.openssl.org/docs/man1.1.0/apps/sha256.html