1
Fork 0
mirror of https://github.com/Steffo99/appunti-magistrali.git synced 2024-11-25 19:44:18 +00:00
appunti-steffo/8 - Crittografia applicata/2 - Comunicazione simmetrica/7 - Implementazioni particolari/2 - Operation framework/operation framework deterministico per crittografia simmetrica a blocchi con initialization vector.md

12 lines
555 B
Markdown
Raw Normal View History

2023-09-21 00:46:23 +00:00
[[operation framework deterministico]] per [[crittografia simmetrica]] con [[initialization vector]] (come un [[cifrario a blocchi]] in [[cipher block chaining operation mode]]).
Prevede i seguenti metodi:
```rust
trait EncryptorBlockByBlockWithInitializationVector<const BLOCK_SIZE, const KEY_SIZE> {
fn keygen() -> [u8; KEY_SIZE];
fn encrypt(key: &[u8; KEY_SIZE], iv: [u8; BLOCK_SIZE], plaintext: [u8; BLOCK_SIZE]) -> [u8; BLOCK_SIZE];
fn decrypt(key: &[u8; KEY_SIZE], iv: [u8; BLOCK_SIZE], ciphertext: [u8; BLOCK_SIZE]) -> [u8; BLOCK_SIZE];
}
```