This article is a mirror article of machine translation, please click here to jump to the original article.

View: 1146|Reply: 0

[Source] .NET/C# uses the SM3 algorithm to generate signatures

[Copy link]
Posted on 2025-3-16 21:34:27 | | | |
Requirements: Connect with the customer, the customer is a Java development project, and both parties need to encrypt and sign the data, in which the signature uses SM3 to generate summary information.

SM3 is a cryptographic hash function standard adopted by the government of the People's Republic of China, released by the State Cryptography Administration on December 17, 2010. The relevant standard is "GM/T 0004-2012 "SM3 Cryptographic Hashing Algorithm".
In commercial cryptography, SM3 is mainly used for digital signature and verification, message authentication code generation and verification, random number generation, etc., and its algorithm is public. According to the National Cryptography Administration, its security and efficiency are comparable to SHA-256.

Announcement of the State Cryptography Administration on the release of the "SM3 Cryptographic Hashing Algorithm":The hyperlink login is visible.
PDF document:The hyperlink login is visible.

The project needs to reference the BouncyCastle.Cryptography library, as follows:

The code is as follows:

As shown below:



Original: itsvse.com Little scum
SM3 Hash: b28255a4e27ffe1147f4907567eda75df391670f004e3420bf010784e53a41c2




Previous:AI (11) Selection of embedding model
Next:Windows uses k6 for HTTP stress testing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com