cipher_magma

Crates.iocipher_magma
lib.rscipher_magma
version0.8.3
sourcesrc
created_at2023-07-07 15:35:42.120118
updated_at2023-08-19 11:52:03.502269
descriptionBlock Cipher Magma (GOST R 34.12-2015, former GOST 28147-89)
homepage
repositoryhttps://github.com/sheroz/magma
max_upload_size
id910873
size88,389
Sheroz Khaydarov (sheroz)

documentation

https://docs.rs/cipher_magma

README

Block Cipher "Magma" (GOST R 34.12-2015, former GOST 28147-89)

crates.io docs build & test MIT

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

Tests are implemented using: crypto_vectors

Tested on platforms

  1. Linux Ubuntu 22.04 LTS / Intel® Core™ i7
  2. MacOS Ventura 13.4 / Apple Macbook Pro M1

Usage

Please look at magma_samples

Samples

Bitmap file encryption results

The original bitmap image: Ferris the crab

Ferris the crab, the original image


Encrypted bitmap in Electronic Codebook Mode (ECB) Mode

Ferris the crab, encrypted in 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.


Encrypted bitmap in Counter Encryption (CTR) Mode

Ferris the crab, encrypted in CTR Mode


Encrypted bitmap in Output Feedback (OFB) Mode

Ferris the crab, encrypted in OFB Mode


Encrypted bitmap in Cipher Block Chaining (CBC) Mode

Ferris the crab, encrypted in CBC Mode


Encrypted bitmap in Cipher Feedback (CFB) Mode

Ferris the crab, encrypted in CFB Mode

Commit count: 95

cargo fmt