Re: [Cfrg] Analysis of ipcrypt?

Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com> Thu, 22 February 2018 06:55 UTC

Return-Path: <jeanphilippe.aumasson@gmail.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0D35B12708C for <cfrg@ietfa.amsl.com>; Wed, 21 Feb 2018 22:55:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 tbPFA8VdZ7vk for <cfrg@ietfa.amsl.com>; Wed, 21 Feb 2018 22:55:29 -0800 (PST)
Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6DCD91242EA for <cfrg@irtf.org>; Wed, 21 Feb 2018 22:55:29 -0800 (PST)
Received: by mail-qt0-x232.google.com with SMTP id k13so5123023qtg.5 for <cfrg@irtf.org>; Wed, 21 Feb 2018 22:55:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=04pd0qYZX6Tpe7bwDXLNmHEKSZluft2aKVJfq4Vbo2k=; b=mzLQL+xXcKZQO1/a42cy0H8k1zI38UwJe3qyDzx15LAWmE78JcF6mM5zIlLPjlSyJr XTiDa8L+2E9+9UQxpHLRA2a1YK1tHlyIBTwKhOdTokVqUJZxUl8K+PnDNcw+5CdKSJFr Y88uN8+7vHlINvlylT2nyL2J4p5RzEvwFaFFrmWd3AnVLZThEuFR37JrsWlEpUVCj1qT 9FGrtHkm1UktM5RUz23KuOaUIhzqhZspYc2sxl9zmPNQ9DGYQC5yxRS5lWMGz0FpCmFL Hs5OQJ7iDKAiVSb9zcttQ7vPesKiHomEDnXGo3OgzsIKED18EuRRFszqWA4LBXB+bpMX H/ig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=04pd0qYZX6Tpe7bwDXLNmHEKSZluft2aKVJfq4Vbo2k=; b=eKvxCG4Kvdjh+2A/DvaiG2kPyAn+aJbJyEAmvPgF6AhGofP/kx0GylpIEv7fwt6BlB wazAvDJy/W34aAcLwPDShx2JDPZifVxzTr2Cfh2MBsopmgzJz/v3YAr8TTb/9ZzcZRit YfMydjjl4VtY6mDkm2f1kg3qrtVWvOXPMQLBOMNU/CmsPiJ8OPTDEPAHQUMV1EbcTpAc kmU0gzGEBOIkWlJiAKbmKwJ9RxbdSWQFDnIFfDOOPYZgtCyM24lJBZjMbtXP38iacgyi 2DRKDqhba8rO8yb2jfzWa9NSeXi2cmk0MWIr1ZDPW1JlLd0PJFXzJrr1MKAUymjfkLUD VtbA==
X-Gm-Message-State: APf1xPC40Hm1LjSe3wptjGsSUVv/tIWvlWLPC6eyd7nwXtwId/LwgIkO KZOTi0JNdLcHJb8pOF+KuF1SiAd3t1UXzad4OHs=
X-Google-Smtp-Source: AH8x226dKUruZOjB9VFdwK0oOe4NfsklPXPayBU4GMWgAOwoafI/KElxbOlJtA6a8wuAZshjip9gl9kFVtM5ncYN/Y4=
X-Received: by 10.237.60.87 with SMTP id u23mr9811950qte.235.1519282528360; Wed, 21 Feb 2018 22:55:28 -0800 (PST)
MIME-Version: 1.0
References: <18C83761-E442-45D9-BDBF-71DC7F751007@icann.org>
In-Reply-To: <18C83761-E442-45D9-BDBF-71DC7F751007@icann.org>
From: Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
Date: Thu, 22 Feb 2018 06:55:17 +0000
Message-ID: <CAGiyFdfP12Y0RwdosFHKLkHKaW=UyhZki+m4G5KsPd8U1Ga3zg@mail.gmail.com>
To: Paul Hoffman <paul.hoffman@icann.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>, "cfrg@irtf.org" <cfrg@irtf.org>
Content-Type: multipart/alternative; boundary="94eb2c1903186a9d130565c78715"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/cFx5WJo48ZEN-a5cj_LlyrdN8-0>
Subject: Re: [Cfrg] Analysis of ipcrypt?
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Feb 2018 06:55:32 -0000

Hi!

I designed ipcrypt as a low-security toy cipher to encrypt IPv4 addresses
for some log analysis application. It may be good enough for this purpose,
however it has very low security:

* because of 32-bit blocks, a chosen-plaintext codebook attack will work in
time 2^32 (or much less for specific IP ranges)

* known-plaintext codebook attacks will work similarly but in O(n log n),
or 2^37 (coupon collector problem)

* there is a generic ~2^16 distinguisher that works by looking for a
collision in a sequence of blocks

* worse, Jason just found a high-probability differential that seems
detectable with fewer than 2^24 chosen-plaintext pair, and which may speed
up key recovery



On Thu, 22 Feb 2018 at 03:03, Paul Hoffman <paul.hoffman@icann.org> wrote:

> Greetings. ipcrypt is a format-preserving cipher for IPv4 addresses. It
> has a 32-bit blocksize for input and output, and 128-bit blocksize for the
> key. It was developed by Jean-Philippe Aumasson and is described at:
>    https://github.com/veorq/ipcrypt
> There doesn't appear to be any formal paper describing the algorithm, but
> the Python and Go code is trivial to follow.
>
> This algorithm is now being considered by a few different projects that
> want to obfuscate IPv4 addresses. Has anyone analyzed the algorithm? I
> could not find analyses, but certainly could have missed them.
>
> For a project I'm on, ipcrypt is attractive if an attacker cannot derive
> the 128-bit random key without a lot (maybe 2^80ish) effort. For cases in
> common use, assume that the attacker has 2^24 known plaintext/ciphertext
> pairs under a single 128-bit random key. For additional ciphertexts, how
> much effort must the attacker expend to get the key in order to decrypt
> additional unknown ciphertexts?
>
> (Note that there are other options for this use case, which have different
> positive and negative features. What we'd like to know is how good is
> ipcrypt if we chose it.)
>
> --Paul Hoffman_______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> https://www.irtf.org/mailman/listinfo/cfrg
>