From d9921db32014140f8048246c87692baf7f00aefb Mon Sep 17 00:00:00 2001 From: Brad Baker <88946291+brdbkr@users.noreply.github.com> Date: Thu, 26 Aug 2021 02:40:53 -0400 Subject: [PATCH] gmssl: add page (#6408) --- pages/common/gmssl.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/gmssl.md diff --git a/pages/common/gmssl.md b/pages/common/gmssl.md new file mode 100644 index 0000000000..56b507f69c --- /dev/null +++ b/pages/common/gmssl.md @@ -0,0 +1,36 @@ +# gmssl + +> GmSSL is a crypto toolkit supporting SM1, SM2, SM3, SM4, SM9, and ZUC/ZUC256. +> More information: . + +- Generate an SM3 hash for a file: + +`gmssl sm3 {{path/to/file}}` + +- Encrypt a file using the SM4 cipher: + +`gmssl sms4 -e -in {{path/to/file}} -out {{path/to/file.sms4}}` + +- Decrypt a file using the SM4 cipher: + +`gmssl sms4 -d -in {{path/to/file.sms4}}` + +- Generate an SM2 private key: + +`gmssl sm2 -genkey -out {{path/to/file.pem}}` + +- Generate an SM2 public key from an existing private key: + +`gmssl sm2 -pubout -in {{path/to/file.pem}} -out {{path/to/file.pem.pub}}` + +- Encrypt a file using the ZUC cipher: + +`gmssl zuc -e -in {{path/to/file}} -out {{path/to/file.zuc}}` + +- Decrypt a file using the ZUC cipher: + +`gmssl zuc -d -in {{path/to/file.zuc}}` + +- Print version: + +`gmssl version`