public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
From: Arno Wagner <arno@wagner.name>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] couple of questions related to using crypto map
Date: Mon, 29 Jun 2020 12:31:42 +0200	[thread overview]
Message-ID: <20200629103142.GA9221@tansi.org> (raw)
In-Reply-To: <a93ee48f-7fc2-bf4e-e712-b0cfca309564@gmx.ch>

On Mon, Jun 29, 2020 at 02:13:21 CEST, Fourhundred Thecat wrote:
> Hello,
> 
> after some experiments, I came up with following 4 questions. I think
> that the answer to all of them is yes, but I would like to confirm this
> with the experts here:
> 
> 1)
> A crypto map aes-xts-plain64:sha512 with a random 512bit key is created
> over a block device. When zeroes are written to the device through the
> crypto map (encrypting), does it generate quality random data on the
> block device (comparable to /dev/urandom)?

Well, yes and no. Yes, if you just ise it once. No, as it gets
written to disk and that is it.
 
> 2)
> The same crypto map over a block device, but the block devices contains
> zeroes. When I read data, will it generate quality random data?
> (comparable to /dev/urandom or a random number generator?)

See above.

> 3)
> If yes should it be the fastest way to generate random data on a typical
> Linux computer, compared to reading /dev/urandom? (especially when
> having AES instruction support in the CPU)

No. /dev/urandom has gotten a lot faster. 

> 4)
> If the data obtained by reading from the zeroed device through that
> crypto map (aes-xts-plain64:sha512) is written back to the block device
> (using the same crypto map and key), will you get the original data? (in
> this example zeros). 

That is how disk encryption works, at least when you do not have
per-sector metadata and LUKS does not.

Regards,
Arno
-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno@wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier

      reply	other threads:[~2020-06-29 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  0:13 [dm-crypt] couple of questions related to using crypto map Fourhundred Thecat
2020-06-29 10:31 ` Arno Wagner [this message]

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=20200629103142.GA9221@tansi.org \
    --to=arno@wagner.name \
    --cc=dm-crypt@saout.de \
    /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