Re: [openpgp] OpenPGP SEIP downgrade attack

Peter Gutmann <> Tue, 06 October 2015 01:49 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 2A3301B3533 for <>; Mon, 5 Oct 2015 18:49:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id K36KzcnwNxeO for <>; Mon, 5 Oct 2015 18:49:43 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 63DF31B3531 for <>; Mon, 5 Oct 2015 18:49:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;;; q=dns/txt; s=mail; t=1444096183; x=1475632183; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=tbRtOOk4ngON0QHEycV5vFep2h+TsURNj9Vz9a3HGHA=; b=YpttZNUwaD5GOx3KD6Jno3loQVvYmPZykfZnZBDSSS1cO/zehaP0phas HJ8kCd0ZqAVb3oWpvgvO9GVG6CWFse4QXnaNvP3qB2Gr0OUWppufiWu1e sSMuMZY3JOMpHEL9E3g2/rPewq5PYe9U0UgU56NYaXG/kVC29ep3SUBbe irGVdYk3R8Z//bqSkkUJXPKO+idCM4XWX2axC3Z/WXld0ZYtWHbCe96Kq HnFLx9VllssKsLuC7znm9EQAABx87XX8AlYWxSB1xb0nfmrbWXN+QdlqS o3V8AIsfBrHaNOT2tBbu/aKsjJRYmcDY5VQevYs59PyHqfgf4YLo8H6Fc A==;
X-IronPort-AV: E=Sophos;i="5.17,641,1437393600"; d="scan'208";a="46650546"
X-Ironport-Source: - Outgoing - Outgoing
Received: from ([]) by with ESMTP/TLS/AES128-SHA; 06 Oct 2015 14:49:41 +1300
Received: from ([]) by ([]) with mapi id 14.03.0174.001; Tue, 6 Oct 2015 14:49:41 +1300
From: Peter Gutmann <>
To: Jonas Magazinius <>, "" <>, "" <>, "" <>
Thread-Topic: [openpgp] OpenPGP SEIP downgrade attack
Thread-Index: AQHQ/3dAIgzGDRicekamqnyxIGnZTZ5dsvDI
Date: Tue, 06 Oct 2015 01:49:40 +0000
Message-ID: <>
References: <>
In-Reply-To: <>
Accept-Language: en-NZ, en-GB, en-US
Content-Language: en-NZ
x-originating-ip: []
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <>
Subject: Re: [openpgp] OpenPGP SEIP downgrade attack
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 06 Oct 2015 01:49:48 -0000

Jonas Magazinius <> writes:

>I've recently been analysing the OpenPGP standard and have found that it 
>is vulnerable to a chosen-ciphertext attack to downgrade an SEIP packet 
>to a plain SE packet. 

Nice work!

>Part of the reason SEIP and MDC was introduced ~15 years ago was to deal 
>with exactly this problem. 

It's always been a quick hack though.  I didn't implement MDC for a long 
time because I was waiting for it to be done properly (encrypt-then-MAC),
but eventually I decided that a hack was better than nothing at all.  It's
really not hard to do properly, just take what CMS / S/MIME did and convert
the bit-bagging to PGP format [0].  Encrypting a non-keyed hash in CFB mode 
of all things is just asking for trouble.

>Different implementations handle SE packets differently.

Is the SEIP -> SE rewrite completely transparent, or are there implementation
quirks/peculiarities that make it work in some cases and not others?  It'd
be interesting to have a sample of a SEIP message with its SE rewrite to look


[0] It specifically protects against strip-the-MAC/rewrite-the-message 
    attacks, but if you *can* find an attack I'd be interested in hearing 
    about it.