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
gpg: encrypted with 4096-bit RSA key, ID 0BB096A1, created 2009-08-12
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


$ 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?

  • Please add the tag "gnupg"
    – guerda
    Oct 15, 2009 at 11:37

3 Answers 3


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.

  • 3
    MDC = Modification Detection Code
    – jjlin
    Jul 6, 2012 at 16:37
  • 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
    Mar 14, 2014 at 12:23
  • @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
    Dec 10, 2014 at 16:41
  • @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
    Dec 10, 2014 at 16:49
  • Hm sure. But not even showing the warning is better, so adding --force-mdc when using -s --symmetric is useful.
    – mirabilos
    Dec 10, 2014 at 17:22

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.

  • 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
    Aug 13, 2009 at 1:00
  • 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.
    – silky
    Aug 13, 2009 at 1:03

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.