Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RustCrypto/block-ciphers
Collection of block cipher algorithms written in pure Rust
https://github.com/RustCrypto/block-ciphers
Last synced: 4 months ago
JSON representation
Collection of block cipher algorithms written in pure Rust
- Host: GitHub
- URL: https://github.com/RustCrypto/block-ciphers
- Owner: RustCrypto
- Created: 2016-12-16T11:35:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T01:59:48.000Z (4 months ago)
- Last Synced: 2024-10-24T17:53:37.797Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 2.45 MB
- Stars: 671
- Watchers: 14
- Forks: 131
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cryptography-rust - block-ciphers
README
# RustCrypto: block ciphers
[![Project Chat][chat-image]][chat-link]
[![dependency status][deps-image]][deps-link]
![Apache2/MIT licensed][license-image]
[![HAZMAT][hazmat-image]][hazmat-link]Collection of [block ciphers] written in pure Rust.
## Higher level constructions
Crates in this repository implement ONLY raw block cipher functionality defined by traits in the [`cipher`] crate.
In practice block ciphers are rarely used in isolation.
Instead, they usually play role of a building block for higher level constructions.
In RustCrypto such constructions are implemented generically over block ciphers in separate repositories:
- [AEADs](https://github.com/RustCrypto/AEADs): GCM, SIV, CCM, MGM, etc.
- [MACs](https://github.com/RustCrypto/MACs): CMAC, PMAC.
- [Block modes](https://github.com/RustCrypto/block-modes): CTR, CBC, CFB, etc.
- [Key wrapping](https://github.com/RustCrypto/key-wraps): AES-KW.Most users should use constructions defined in these repositories without directly relying on raw block cipher functionality.
[`cipher`]: https://docs.rs/cipher
## Warnings
Currently only the `aes` crate provides constant-time implementation and has received a third-party security audit.
Other crates in this repository are not implemented in a constant-time manner and have not yet received any formal cryptographic and security reviews.
It's generally recommended not to use other cipher implementations in this repository besides the `aes` crate.
**USE AT YOUR OWN RISK.**
## Supported algorithms
| Name | Crate name | crates.io | Docs | MSRV |
|------|------------|-----------|------|------|
| [AES] (Rijndael) | [`aes`] | [](https://crates.io/crates/aes) | [](https://docs.rs/aes) | ![MSRV 1.65][msrv-1.65] |
| [ARIA] | [`aria`] | [](https://crates.io/crates/aria) | [](https://docs.rs/aria) | ![MSRV 1.65][msrv-1.65] |
| [BelT] block cipher | [`belt-block`] | [](https://crates.io/crates/belt-block) | [](https://docs.rs/belt-block) | ![MSRV 1.65][msrv-1.65] |
| [Blowfish] | [`blowfish`] | [](https://crates.io/crates/blowfish) | [](https://docs.rs/blowfish) | ![MSRV 1.65][msrv-1.65] |
| [Camellia] | [`camellia`] | [](https://crates.io/crates/camellia) | [](https://docs.rs/camellia) | ![MSRV 1.65][msrv-1.65] |
| [CAST5] (CAST-128) | [`cast5`] | [](https://crates.io/crates/cast5) | [](https://docs.rs/cast5) | ![MSRV 1.65][msrv-1.65] |
| [CAST6] (CAST-256) | [`cast6`] | [](https://crates.io/crates/cast6) | [](https://docs.rs/cast6) | ![MSRV 1.65][msrv-1.65] |
| [DES] + [3DES] (DEA, 3DEA) | [`des`] | [](https://crates.io/crates/des) | [](https://docs.rs/des) | ![MSRV 1.65][msrv-1.65] |
| [IDEA] | [`idea`] | [](https://crates.io/crates/idea) | [](https://docs.rs/idea) | ![MSRV 1.65][msrv-1.65] |
| [Kuznyechik] (GOST R 34.12-2015) | [`kuznyechik`] | [](https://crates.io/crates/kuznyechik) | [](https://docs.rs/kuznyechik) | ![MSRV 1.65][msrv-1.65] |
| [Magma] (GOST R 34.12-2015) | [`magma`] | [](https://crates.io/crates/magma) | [](https://docs.rs/magma) | ![MSRV 1.65][msrv-1.65] |
| [RC2] (ARC2) | [`rc2`] | [](https://crates.io/crates/rc2) | [](https://docs.rs/rc2) | ![MSRV 1.65][msrv-1.65] |
| [RC5] | [`rc5`] | [](https://crates.io/crates/rc5) | [](https://docs.rs/rc5) | ![MSRV 1.65][msrv-1.65] |
| [Serpent] | [`serpent`] | [](https://crates.io/crates/serpent) | [](https://docs.rs/serpent) | ![MSRV 1.65][msrv-1.65] |
| [SM4] | [`sm4`] | [](https://crates.io/crates/sm4) | [](https://docs.rs/sm4) | ![MSRV 1.65][msrv-1.65] |
| [Speck] | [`speck-cipher`] | [](https://crates.io/crates/speck-cipher) | [](https://docs.rs/speck-cipher) | ![MSRV 1.65][msrv-1.65] |
| [Threefish] | [`threefish`] | [](https://crates.io/crates/threefish) | [](https://docs.rs/threefish) | ![MSRV 1.65][msrv-1.65] |
| [Twofish] | [`twofish`] | [](https://crates.io/crates/twofish) | [](https://docs.rs/twofish) | ![MSRV 1.65][msrv-1.65] |
| [XTEA] | [`xtea`] | [](https://crates.io/crates/xtea) | [](https://docs.rs/xtea) | ![MSRV 1.65][msrv-1.65] |### Minimum Supported Rust Version (MSRV) Policy
MSRV bump is considered a breaking change and will be performed only with a minor version bump.
## License
All crates licensed under either of
* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [MIT license](http://opensource.org/licenses/MIT)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.[//]: # (badges)
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260039-block-ciphers
[deps-image]: https://deps.rs/repo/github/RustCrypto/block-ciphers/status.svg
[deps-link]: https://deps.rs/repo/github/RustCrypto/block-ciphers
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[hazmat-image]: https://img.shields.io/badge/crypto-hazmat%E2%9A%A0-red.svg
[hazmat-link]: https://github.com/RustCrypto/meta/blob/master/HAZMAT.md
[msrv-1.65]: https://img.shields.io/badge/rustc-1.65.0+-blue.svg[//]: # (crates)
[`aes`]: ./aes
[`aria`]: ./aria
[`belt-block`]: ./belt-block
[`blowfish`]: ./blowfish
[`camellia`]: ./camellia
[`cast5`]: ./cast5
[`cast6`]: ./cast6
[`des`]: ./des
[`idea`]: ./idea
[`kuznyechik`]: ./kuznyechik
[`magma`]: ./magma
[`rc2`]: ./rc2
[`rc5`]: ./rc5
[`serpent`]: ./serpent
[`sm4`]: ./sm4
[`speck-cipher`]: ./speck
[`threefish`]: ./threefish
[`twofish`]: ./twofish
[`xtea`]: ./xtea[//]: # (links)
[block ciphers]: https://en.wikipedia.org/wiki/Block_cipher
[//]: # (algorithms)
[AES]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
[ARIA]: https://en.wikipedia.org/wiki/ARIA_(cipher)
[BelT]: https://ru.wikipedia.org/wiki/BelT
[Blowfish]: https://en.wikipedia.org/wiki/Blowfish_(cipher)
[Camellia]: https://en.wikipedia.org/wiki/Camellia_(cipher)
[CAST5]: https://en.wikipedia.org/wiki/CAST-128
[CAST6]: https://en.wikipedia.org/wiki/CAST-256
[DES]: https://en.wikipedia.org/wiki/Data_Encryption_Standard
[3DES]: https://en.wikipedia.org/wiki/Triple_DES
[IDEA]: https://simple.wikipedia.org/wiki/International_Data_Encryption_Algorithm
[Kuznyechik]: https://en.wikipedia.org/wiki/Kuznyechik
[Magma]: https://en.wikipedia.org/wiki/GOST_(block_cipher)
[RC2]: https://en.wikipedia.org/wiki/RC2
[RC5]: https://en.wikipedia.org/wiki/RC5
[Serpent]: https://en.wikipedia.org/wiki/Serpent_(cipher)
[SM4]: https://en.wikipedia.org/wiki/SM4_(cipher)
[Speck]: https://en.wikipedia.org/wiki/Speck_(cipher)
[Threefish]: https://en.wikipedia.org/wiki/Threefish
[Twofish]: https://en.wikipedia.org/wiki/Twofish
[XTEA]: https://en.wikipedia.org/wiki/XTEA