public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
From: "huxiaoyu@horebdata.cn" <huxiaoyu@horebdata.cn>
To: Milan Broz <gmazyland@gmail.com>, dm-crypt <dm-crypt@saout.de>
Subject: Re: [dm-crypt] Request on support of SM3 and SM4
Date: Mon, 30 Dec 2019 10:26:54 +0100	[thread overview]
Message-ID: <201912301026524657678@horebdata.cn> (raw)
In-Reply-To: 6fde00aa-6fca-115d-a696-7190eb7e0950@gmail.com

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

Dear Milan,

Thanks for the information. It is interesting to know that recent kernel has included the support of SM3/SM4. 

BTW, what is the kernel version of the Debian system (Debian 9?) that you are using?  I would like to try it.

best regards,

samuel



huxiaoyu@horebdata.cn
 
From: Milan Broz
Date: 2019-12-30 10:16
To: huxiaoyu@horebdata.cn; dm-crypt
Subject: Re: [dm-crypt] Request on support of SM3 and SM4
On 28/12/2019 09:08, huxiaoyu@horebdata.cn wrote:
> SM3/4 is a block cipher similar to DES and AES, and has been supported by openSSL rencently. Does dm-crypt (LUKS) support the use of SM3/SM4? and if yes, how to
 
Hi,
 
SM3 is a hash function, if userspace backend (usually OpenSSL) supports it, you can use it
for header hash ans anti-forensic funciton, you can try it with benchmark, for example:
 
   cryptsetup benchmark --pbkdf pbkdf2 --hash sm3 --key-size 128
   # Tests are approximate using memory only (no storage IO).
   PBKDF2-sm3       1076566 iterations per second for 128-bit key
 
SM4 is a block cipher, if kernel crypto supports it (for dm-crypt, recent kernel contains the module),
you can use it for data encryption, again, you can check support using benchmark, for example:
 
   cryptsetup benchmark --cipher sm4-xts-plain64 --key-size 256
   # Tests are approximate using memory only (no storage IO).
   # Algorithm |       Key |      Encryption |      Decryption
       sm4-xts        256b        40.3 MiB/s        40.1 MiB/s
 
 
So, both are easily used in LUKS format:
 
   cryptsetup luksFormat --cipher sm4-xts-plain64 --key-size 256 --hash sm3 <device>
 
Note, that not all crypto backends and kernel support it, also I have no idea
how it is secure and if there is any analysis of these Chinese algorithms in the FDE context.
 
Anyway, it works out of the box, at least on my Debian system.
 
Milan
_______________________________________________
dm-crypt mailing list
dm-crypt@saout.de
https://www.saout.de/mailman/listinfo/dm-crypt
 

[-- Attachment #2: Type: text/html, Size: 4030 bytes --]

  reply	other threads:[~2019-12-30  9:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-28  8:08 [dm-crypt] Request on support of SM3 and SM4 huxiaoyu
2019-12-30  9:16 ` [dm-crypt] **** SPAM **** " Milan Broz
2019-12-30  9:26   ` huxiaoyu [this message]
     [not found]   ` <5e09c2e7.1c69fb81.f990b.c436SMTPIN_ADDED_BROKEN@mx.google.com>
2019-12-30  9:43     ` [dm-crypt] " Milan Broz

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=201912301026524657678@horebdata.cn \
    --to=huxiaoyu@horebdata.cn \
    --cc=dm-crypt@saout.de \
    --cc=gmazyland@gmail.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