Skip to content

English Page

black-06 edited this page Jul 26, 2021 · 3 revisions

About

gm4j is the implementation of the Chinese security standardization algorithm in java.

see Chinese cryptography standardization technical committee

Features

  • SM3 security algorithm
  • Other GM algorithms are being implemented...
  • A java security provider
  • A convenient security tool

Usage

Calculate the SM3 hash value of byte[]

byte[]abc="abc".getBytes(StandardCharsets.US_ASCII);
GMUtil.sm3(abc);
// or
GMProvider provider=new GMProvider();
MessageDigest digest=MessageDigest.getInstance("SM3", provider);
digest.digest(abc);

Calculate the SM3 hash value of string

GMUtil.sm3("abc");

Calculate the SM3 hash string of the string and convert it to a hexadecimal string

GMUtil.sm3Hex("abc");

Other

1.License

This code is under the Apache Licence v2.

2.Contact me

hello.bug@foxmail.com

Clone this wiki locally