22 releases (6 breaking)
0.8.3 | Aug 19, 2023 |
---|---|
0.8.2 | Aug 18, 2023 |
0.7.1 | Aug 5, 2023 |
0.6.3 | Jul 27, 2023 |
0.2.4 | Jul 7, 2023 |
#1449 in Cryptography
Used in sheroz
87KB
1.5K
SLoC
Block Cipher "Magma" (GOST R 34.12-2015, former GOST 28147-89)
Supported Cipher Modes
- ECB - Electronic Codebook Mode
- CTR - Counter Encryption Mode
- CTR-ACPKM - Counter Encryption Mode as per RFC8645
- OFB - Output Feedback Mode
- CBC - Cipher Block Chaining Mode
- CFB - Cipher Feedback Mode
- MAC - Message Authentication Code Generation Mode
Implemented and tested according to specifications
- RFC 8891 a.k.a GOST R 34.12-2015: Block Cipher "Magma"
- RFC 5830 a.k.a GOST 28147-89
- Block Cipher Modes:
Tests are implemented using: crypto_vectors
Tested on platforms
- Linux Ubuntu 22.04 LTS / Intel® Core™ i7
- MacOS Ventura 13.4 / Apple Macbook Pro M1
Usage
Please look at magma_samples
Samples
- Block encryption encrypt_block.rs
- Text encryption encrypt_text.rs
- Message Authentication Code (MAC) calculate_mac.rs
- Buffer encryption encrypt_buffer.rs
- Buffer encryption by parallel processing encrypt_buffer_parallel.rs
- File encryption encrypt_file.rs
- Bitmap file encryption encrypt_bmp.rs
Bitmap file encryption results
The original bitmap image: Ferris the crab
Encrypted bitmap in Electronic Codebook Mode (ECB) Mode
Please note that ECB has weaknesses. It does not hide data patterns well and leaks information about the plaintext. ECB mode is not recommended for use in cryptographic protocols.