From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Mon, 30 Dec 2019 10:16:50 +0100 (CET) Received: by mail-wr1-x42b.google.com with SMTP id t2so32090648wrr.1 for ; Mon, 30 Dec 2019 01:16:50 -0800 (PST) References: <201912280908402097647@horebdata.cn> From: Milan Broz Message-ID: <6fde00aa-6fca-115d-a696-7190eb7e0950@gmail.com> Date: Mon, 30 Dec 2019 10:16:47 +0100 MIME-Version: 1.0 In-Reply-To: <201912280908402097647@horebdata.cn> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] **** SPAM **** Request on support of SM3 and SM4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "huxiaoyu@horebdata.cn" , dm-crypt 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 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