qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Hamilton, Peter A." <Peter.Hamilton@jhuapl.edu>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qemu-img create encryption
Date: Thu, 27 Jun 2013 10:36:16 +0100	[thread overview]
Message-ID: <20130627093616.GA2621@redhat.com> (raw)
In-Reply-To: <EE1A64E628992240A94E2B625745F01674FD425CB8@aplesstripe.dom1.jhuapl.edu>

On Wed, Jun 26, 2013 at 02:52:51PM -0400, Hamilton, Peter A. wrote:
> I've been doing some work with qemu-img and encrypted qcow2 images and have
> noticed that "qemu-img create" does not prompt for a password to encrypt new
> images, defaulting (from the documentation I've read) to the empty string as
> a password. Why does "qemu-img create" work this way?
> 
> I haven't been able to find any good, authoritative sources on this topic,
> so if anyone knows of good documentation or rationale, please let me know.

The qcow2 encryption format is very simple. The password you provide is
directly used to encrypt the data blocks. There is level on indirection
as you have with, say LUKS, whereby the user password is used to encrypt
a separate key in the file header. As such there is no need for the qcow2
encryption key to be known when creating a file, only when reading/writing
data blocks.

Using the password directly as the encryption key makes the qcow2 data
encryption very vulnerable to weak passwords. It also means you can't
change the password of an existing image - you have to create a new image
with a new password & re-encrypt the data. LUKS is a much stronger crypto
design that qcow2's built-in encryption. I'd like to see qemu gain a block
driver that could natively support the LUKS data format as a strong replacement
for qcow2's encryption approach, but there's no work in this area.

Regards,
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 :|

  parent reply	other threads:[~2013-06-27  9:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 18:52 [Qemu-devel] qemu-img create encryption Hamilton, Peter A.
2013-06-27  7:27 ` Markus Armbruster
2013-06-27  9:36 ` Daniel P. Berrange [this message]
2013-06-27 12:05   ` Hamilton, Peter A.
2013-06-27 12:57     ` 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=20130627093616.GA2621@redhat.com \
    --to=berrange@redhat.com \
    --cc=Peter.Hamilton@jhuapl.edu \
    --cc=qemu-devel@nongnu.org \
    /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).