8 releases (breaking)

Uses new Rust 2024

0.6.0-rc.2 Nov 5, 2025
0.5.1 Feb 17, 2022
0.4.0 Apr 29, 2021
0.3.0 Oct 16, 2020
0.0.0 Oct 14, 2019

#2958 in Cryptography

Download history 758/week @ 2025-08-31 652/week @ 2025-09-07 946/week @ 2025-09-14 1276/week @ 2025-09-21 389/week @ 2025-09-28 1102/week @ 2025-10-05 1209/week @ 2025-10-12 901/week @ 2025-10-19 788/week @ 2025-10-26 845/week @ 2025-11-02 960/week @ 2025-11-09 1316/week @ 2025-11-16 1352/week @ 2025-11-23 1258/week @ 2025-11-30 1338/week @ 2025-12-07 210/week @ 2025-12-14

4,196 downloads per month
Used in 13 crates (8 directly)

MIT/Apache

13KB
184 lines

RustCrypto: SM4 Cipher

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status HAZMAT

Pure Rust implementation of the SM4 block cipher.

⚠️ Security Warning: Hazmat!

This crate does not ensure ciphertexts are authentic (i.e. by using a MAC to verify ciphertext integrity), which can lead to serious vulnerabilities if used incorrectly!

No security audits of this crate have ever been performed, and it has not been thoroughly assessed to ensure its operation is constant-time on common CPU architectures.

USE AT YOUR OWN RISK!

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~695KB
~18K SLoC