gpg: WARNING: message was not integrity protected

14

1

I'm a little confused as what this means.

What's happened is that someone has encrypted a message for me using my public key, and signed it with their private key - as per usual.

Next, I decrypt the message...

-bash-3.2$ gpg --decrypt /tmp/det_prod_cred.txt.asc 
gpg: encrypted with 2048-bit ELG-E key, ID 2E52ED13, created 2001-10-15
      "XXXXXXX1"
gpg: encrypted with 4096-bit RSA key, ID 0BB096A1, created 2009-08-12
      "XXXXXXX2"
username = XXXXXXXXXX3  
password = XXXXXXXXXX4
gpg: Signature made Wed 12 Aug 2009 15:47:17 EST using DSA key ID C2E36CC8
gpg: Good signature from "17155x01"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 826A E10D 8AAB 49A0 E9B6  0478 3A70 240F C2E3 6CC8
gpg: WARNING: message was not integrity protected

...I know the message is verbose and I probably should understand what it is getting at - but I'm not confident that I do - so any further explanation on this would be appreciated.

Is it basically saying that the person who has signed this message, does not pass the rules defined in my trustdb?

$ gpg --update-trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u

While...

$ gpg --edit-key 0xC2E36CC8
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


pub  1024D/C2E36CC8  created: 2001-10-15  expires: never       usage: SCA 
                     trust: marginal      validity: unknown
sub  2048g/2E52ED13  created: 2001-10-15  expires: never       usage: E   
[ unknown] (1). 17155x01

Notice I've only marginally trusted the key, if I fully trust it (which I can't), will the problem disappear?

Darius

Posted 2009-08-13T00:52:00.583

Reputation: 261

Please add the tag "gnupg" – guerda – 2009-10-15T11:37:39.653

Answers

18

There are two different warnings here, and I think the other responders are assuming the one is caused by the other.

I assume the "message was not integrity protected" warning is your main concern, since that's the title of this question. There seem to be several things that can cause that, but the one I just encountered is when GPG's "MDC protection" feature isn't enabled. I don't know what it stands for, but apparently it's a message integrity check that proves the message hasn't been tampered with.

Apparently this feature is on by default, but gets disabled if any of the recipient keys don't specify they support it. So I just got the warning for the first time when adding a new recipient to a file I'd previously been encrypting only to myself, presumably because the new recipient didn't say they supported MDC.

I got the warning to go away by adding --force-mdc to my GPG command. I haven't yet discovered whether this prevents the new recipient from decrypting the message...

I'm pretty sure the other warning, about the key not being trusted, is unrelated to the "not integrity protected" warning.

Sam Stokes

Posted 2009-08-13T00:52:00.583

Reputation: 516

@gertvdijk I got the message for a file I used -s --symmetric on, so this alone does not help. Using --force-mdc -s --symmetric on encryption worked, though. – mirabilos – 2014-12-10T16:41:16.433

@mirabilos Hmm. I did not experience that. It is a bogus message then anyway as one can validate the integrity based on the signature. – gertvdijk – 2014-12-10T16:49:57.557

Hm sure. But not even showing the warning is better, so adding --force-mdc when using -s --symmetric is useful. – mirabilos – 2014-12-10T17:22:27.253

3MDC = Modification Detection Code – jjlin – 2012-07-06T16:37:59.950

MDC is only needed for in cases when you don't sign the encrypted file, because the recipient can check the integrity of the file by the sender's signature. So, just be sure to sign the encrypted file. However, for symmetric encryption (using passphrases), see How do I fix “WARNING: message was not integrity protected” when using GPG symmetrical encryption?

– gertvdijk – 2014-03-14T12:23:00.527

2

In gpg, you don't yet 'trust' the sender. So even though it's from yourmate@whatever, you haven't set their trust level in gpg to whatever it needs to be to not get that message :)

At least that's what I think; could be wrong. GPG docs should help though.

Noon Silk

Posted 2009-08-13T00:52:00.583

Reputation: 161

I was thinking along the same line, but to test this, I temporarily trusted their key "ultimately", and the decrypted the message again - however the warning has not budged. I was very hopeful for a second there :) – Darius – 2009-08-13T01:00:31.620

Interesting ....

Then, now I'm just guessing, it's got something to do with the fact that maybe it's not registered on any keyservers. I give up though, I'd suggest the docs :) Sorry. – None – 2009-08-13T01:03:15.380

0

What silky said: you don't trust the sender.

However you may also need to sign the sender's key.

Broam

Posted 2009-08-13T00:52:00.583

Reputation: 3 831