Linux FSCRYPT development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Xiubo Li <xiubli@redhat.com>
Cc: Luis Henriques <lhenriques@suse.de>, linux-fscrypt@vger.kernel.org
Subject: Re: Is there any userland implementations of fscrypt
Date: Mon, 20 Mar 2023 14:19:08 -0700	[thread overview]
Message-ID: <20230320211908.GC1434@sol.localdomain> (raw)
In-Reply-To: <ffa49a00-4b3f-eeb3-6db8-11509fd08c9b@redhat.com>

[+Cc linux-fscrypt]

On Mon, Mar 20, 2023 at 06:49:29PM +0800, Xiubo Li wrote:
> Hi Eric,
> 
> BTW, I am planing to support the fscrypt in userspace ceph client. Is there
> any userland implementation of fscrypt ? If no then what should I use
> instead ?
> 

I assume that you mean userspace code that encrypts files the same way the
kernel does?

There's some code in xfstests that reproduces all the fscrypt encryption for
testing purposes
(https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/src/fscrypt-crypt-util.c?h=for-next).
It does *not* use production-quality implementations of the algorithms, though.
It just has minimal implementations for testing without depending on OpenSSL.

Similar testing code can also be found in Android's vts_kernel_encryption_test
(https://android.googlesource.com/platform/test/vts-testcase/kernel/+/refs/heads/master/encryption).
It uses BoringSSL for the algorithms when possible, but unlike the xfstest it
does not test filenames encryption.

There's also some code in mkfs.ubifs in mtd-utils
(http://git.infradead.org/mtd-utils.git) that supports creating encrypted files.
However, it's outdated since it only supports policy version 1.

Which algorithms do you need to support?  The HKDF-SHA512 + AES-256-XTS +
AES-256-CTS combo shouldn't be hard to support if your program can depend on
OpenSSL (1.1.0 or later).

- Eric

       reply	other threads:[~2023-03-20 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ffa49a00-4b3f-eeb3-6db8-11509fd08c9b@redhat.com>
2023-03-20 21:19 ` Eric Biggers [this message]
2023-03-21  1:03   ` Is there any userland implementations of fscrypt Xiubo Li
2023-03-21  1:21     ` Eric Biggers

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=20230320211908.GC1434@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=lhenriques@suse.de \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=xiubli@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