public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jari Ruusu <jariruusu@users.sourceforge.net>
To: Jan Rychter <jan@rychter.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Oopsing cryptoapi (or loop device?) on 2.6.*
Date: Thu, 19 Feb 2004 15:34:54 +0200	[thread overview]
Message-ID: <4034BB7E.4ED20C2@users.sourceforge.net> (raw)
In-Reply-To: m2ekssf4ml.fsf@tnuctip.rychter.com

[-- Attachment #1: Type: text/plain, Size: 2903 bytes --]

Jan Rychter wrote:
> And, just wondering -- if loop-AES works so much better, why hasn't it
> been included in the kernel?

Because I stopped wasting my time with mainline kernels long time ago, and
because mainline folks seemed to prefer the most vulnerable loop crypto
implementation they could find (i.e. cryptoloop).

Just look at mainline folks merging another equally vulnerable and exploitable
implementation (i.e. dm-crypt), with exactly same vulnerabilities that
cryptoloop has, just in different package.

In loop-AES, "bad key management" issues were fixed years ago, and more
stronger IV was merged last year. Mainline folks still seem to be
puzzled/clueless with these issues.

-

Markku-Juhani O. Saarinen discovered watermark attack against cryptoloop,
here is his paper:

    http://www.tcs.hut.fi/~mjos/doc/diskenc.pdf

[just before posting I tested above link and it returns "You don't have
permission to access /~mjos/doc/diskenc.pdf on this server", ugh]

This attack exploits weakness in IV computation and knowledge of how file
systems place files on disk. This attack works with file systems that have
soft block size of 1024 or greater. At least ext2, ext3, reiserfs and minix
have such property. Don't know about xfs. This attack makes it possible to
detect presense of specially crafted watermarked files, such as, unreleased
Hollywood movies, cruise missile service manuals, and other content that you
did not create yourself. Watermarked files contain special bit patterns that
can be detected without decryption.

I have attached source for two programs, one to create such watermarked
files, and one to detect watermarks from ciphertext.

For example, if I were to encode my first name Jari as a watermark, I would
use ASCII characters 74 97 114 105. This example uses encodings 10...13.

    # mount -t ext2 /dev/fd0 /mnt -o loop=/dev/loop0,encryption=AES128
    Password:
    # ./create-watermark-encodings 10:74 11:97 12:114 13:105 >/mnt/watermarks
    # umount /mnt

And then to detect these watermarks, I do:

    # dd if=/dev/fd0 bs=64k | ./detect-watermark-encodings
    22+1 records in
    22+1 records out
    1474560 bytes scanned
    watermark encoding 10, count 74
    watermark encoding 11, count 97
    watermark encoding 12, count 114
    watermark encoding 13, count 105
    
Summary:
- cryptoloop and dm-crypt on-disk formats are FUBAR. cryptoloop and
  dm-crypto developers and users don't have any choice here. The _have_ to
  start using stronger crypto.
- Used cipher or key kength or password does not matter.
- loop-AES single-key mode on-disk format is equally FUBAR.  
- loop-AES multi-key mode is not vulnerable.
- Anyone still setting up new encrypted file systems using cryptoloop or
  current dm-crypt or single-key loop-AES, is committing security
  malpractice.

-- 
Jari Ruusu  1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD

[-- Attachment #2: cryptoloop-exploit.tar.bz2 --]
[-- Type: application/octet-stream, Size: 1496 bytes --]

  reply	other threads:[~2004-02-19 13:34 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-11 15:33 Oopsing cryptoapi (or loop device?) on 2.6.* Michal Kwolek
2004-02-11 18:41 ` Jari Ruusu
2004-02-15  2:35   ` Jan Rychter
2004-02-15 14:51     ` Jari Ruusu
2004-02-15 16:38       ` Jari Ruusu
2004-02-16  0:26       ` James Morris
2004-02-18 14:07         ` Bill Davidsen
2004-02-16 12:22       ` Jan Rychter
2004-02-17 14:09         ` Jari Ruusu
2004-02-17 19:14           ` Jan Rychter
2004-02-18 14:06             ` Jari Ruusu
2004-02-18 21:40               ` Jan Rychter
2004-02-19 13:34                 ` Jari Ruusu [this message]
2004-02-11 22:54 ` bill davidsen
2004-02-15 17:34 ` Christophe Saout
2004-02-15 18:02   ` Christoph Hellwig
2004-02-15 18:42     ` Christophe Saout
2004-02-15 18:53       ` Christoph Hellwig
2004-02-15 19:36         ` Christophe Saout
2004-02-15 19:46           ` Christoph Hellwig
2004-02-15 20:24             ` kthread vs. dm-daemon (was: Oopsing cryptoapi (or loop device?) on 2.6.*) Christophe Saout
2004-02-15 22:13               ` kthread vs. dm-daemon Mike Christie
2004-02-16  0:04                 ` Christophe Saout
2004-02-16  1:04                   ` Mike Christie
2004-02-16  1:29                     ` Christophe Saout
2004-02-16  3:02               ` kthread vs. dm-daemon (was: Oopsing cryptoapi (or loop device?) on 2.6.*) Rusty Russell
2004-02-16 13:27                 ` Christophe Saout
2004-02-16 16:42                   ` Christophe Saout
2004-02-16 13:48                 ` Joe Thornber
2004-02-16  1:44             ` dm-crypt using kthread " Christophe Saout
2004-02-16  1:53               ` Andrew Morton
2004-02-16  2:07                 ` Grzegorz Kulewski
2004-02-16  3:03                   ` Christophe Saout
2004-02-16  3:22                     ` Grzegorz Kulewski
2004-02-16  4:05                       ` dm-crypt using kthread Jeff Garzik
2004-02-16  4:14                         ` Grzegorz Kulewski
2004-02-16 10:15                           ` Christophe Saout
2004-02-16  9:54                       ` dm-crypt using kthread (was: Oopsing cryptoapi (or loop device?) on 2.6.*) Christophe Saout
2004-03-01 22:18                     ` Matthias Urlichs
2004-03-01 22:51                       ` Christophe Saout
2004-03-01 23:22                         ` Matthias Urlichs
2004-02-16  2:58                 ` Christophe Saout
2004-02-16  7:28                   ` David Wagner
2004-02-16 10:11                     ` Christophe Saout
2004-02-18 14:15                 ` dm-crypt using kthread Bill Davidsen
2004-02-16  2:07               ` dm-crypt using kthread (was: Oopsing cryptoapi (or loop device?) on 2.6.*) Andrew Morton
2004-02-16  2:17                 ` dm-crypt using kthread Jeff Garzik
2004-02-16  2:53                 ` dm-crypt using kthread (was: Oopsing cryptoapi (or loop device?) on 2.6.*) Christophe Saout
2004-02-16  2:10               ` dm-crypt using kthread Jeff Garzik
2004-02-16  2:40                 ` Christophe Saout
2004-02-16  2:58                   ` Jeff Garzik
2004-02-16  3:10                     ` Christophe Saout
2004-02-16 13:04                     ` Christophe Saout
2004-02-16 19:09                       ` Jeff Garzik

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=4034BB7E.4ED20C2@users.sourceforge.net \
    --to=jariruusu@users.sourceforge.net \
    --cc=jan@rychter.com \
    --cc=linux-kernel@vger.kernel.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