ofb method
The Output Feedback (OFB) mode operates similarly to CFB but generates the keystream independently of both plaintext and ciphertext. This makes OFB immune to transmission errors but requires careful management of the IV to avoid security issues.
This implementation follows the specification from (NIST SP 800-38A) - Recommendation for Block Cipher Modes of Operation: Methods and Techniques.
Parameters:
iv
(initialization vector) is the random 16-byte salt.
(Key) PT1
| |
v v
IV ---> [AES] ------> (XOR) ---> CT1
____________________|
|
| (Key) PT2
| | |
| v v
---> [AES] ------> (XOR) ---> CT2
Implementation
AESInOFBMode ofb(
List<int> iv, [
int sbyte = 16,
]) =>
AESInOFBMode(
key,
iv: iv,
sbyte: sbyte,
);