qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Benoît Canet" <benoit.canet@irqsave.net>,
	qemu-devel@nongnu.org, stefanha@redhat.com,
	"Stefan Hajnoczi" <stefanha@gmail.com>
Subject: Re: [Qemu-devel] QCOW2 cryptography and secure key handling
Date: Wed, 24 Jul 2013 16:46:39 +0100	[thread overview]
Message-ID: <20130724154639.GE30336@redhat.com> (raw)
In-Reply-To: <51EFF55E.6070700@redhat.com>

On Wed, Jul 24, 2013 at 05:40:14PM +0200, Paolo Bonzini wrote:
> Il 24/07/2013 17:33, Daniel P. Berrange ha scritto:
> >>> One reason that QCow2 is bad, despite using a standard algorithm, is
> >>> that the user passphrase is directly used encrypt/decrypt the data.
> >>> Thus a weak passphrase leads to weak data encryption. With the LUKS
> >>> format, the passphrase is only used to unlock the master key, which
> >>> is cryptographically strong. LUKS applies multiple rounds of hashing
> >>> to the user passphrase based on the speed of the machine CPUs, to
> >>> make it less practical to brute force weak user passphrases and thus
> >>> recover the master key.
> >>
> >> Another reason that QCow2 is bad is that disk encryption is Complicated.
> >>  Even if you do not do any horrible mistakes such as using ECB
> >> encryption, a disk encrypted sector-by-sector has a lot of small
> >> separate cyphertexts in it and is susceptible to a special range of attacks.
> >>
> >> For example, current qcow2 encryption is vulnerable to a watermarking
> >> attack.
> >> http://en.wikipedia.org/wiki/Disk_encryption_theory#Cipher-block_chaining_.28CBC.29
> >>
> >> dm-crypt or other disk encryption programs use more complicated schemes,
> >> do we need to go there?
> > 
> > Yep, that is another particularly good reason to deprecate qcow2's
> > existing aes encryption and adopt an existing format that has got
> > a proven good design like LUKS.
> 
> Note that this is independent of LUKS vs. anything else.  LUKS only
> provides the key, you then have to implement encryption yourself.  And
> full implementation of all the cyphers and modes that LUKS supports
> would be a lot of work.
> 
> In fact, LUKS supports a cypher mode as weak as the current qcow2 mode
> ("cbc-plain") and it even supports ECB.  And dually, adding a more
> robust cypher mode to the current qcow2 encryption would be trivial and
> would protect against the watermarking attack (it would not fix the
> problems with keys, of course, so I'm not suggesting to do it).

True, implementing all the algorithms that the kernel supports for
LUKS would be alot of work, and mostly a waste of time for the weak
modes. So we'd probably want to be pragmatic about what we targetted,
and pick a handful of common ciphers which are considered strong
and commonly used by high quality disk encryption software.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2013-07-24 15:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 12:47 [Qemu-devel] QCOW2 cryptography and secure key handling Benoît Canet
2013-07-23 13:00 ` Daniel P. Berrange
2013-07-23 13:21   ` Benoît Canet
2013-07-23 14:40   ` Benoît Canet
2013-07-23 15:22     ` Stefan Hajnoczi
2013-07-23 15:38       ` Kevin Wolf
2013-07-23 15:57         ` Daniel P. Berrange
2013-07-24 13:07           ` Benoît Canet
2013-07-24 15:30           ` Paolo Bonzini
2013-07-24 15:33             ` Daniel P. Berrange
2013-07-24 15:40               ` Paolo Bonzini
2013-07-24 15:46                 ` Daniel P. Berrange [this message]
2013-07-29 11:21             ` Markus Armbruster
2013-07-29 11:25               ` Kevin Wolf
2013-07-29 11:32                 ` Daniel P. Berrange
2013-07-29 16:07                   ` Benoît Canet
2013-07-31 15:33               ` Benoît Canet
2013-07-31 15:27             ` Benoît Canet
2013-07-31 17:52               ` Laszlo Ersek
2013-07-31 18:31                 ` Laszlo Ersek
2013-07-23 15:40       ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130724154639.GE30336@redhat.com \
    --to=berrange@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).