AES-128-OFB
Output Feedback mode: a synchronous stream cipher from repeatedly encrypting the IV
About AES-128-OFB
AES-128-OFB is one of 3 AES-OFB variants in the NextSSL registry, a stream cipher. It uses a 16-byte (128-bit) key and a 16-byte nonce. Its registry entry cites NIST SP 800-38A. It is also known as aes128-ofb. NextSSL lists it in the standard tier and exposes it through the safe API.
Overview
OFB (Output Feedback) is a block cipher mode defined in NIST SP 800-38A in which the block cipher is applied repeatedly to the IV to produce a keystream. Like CTR it needs no padding, but unlike CTR it cannot be parallelised.
OFB encrypts the IV to obtain the first keystream block, then encrypts that block to obtain the next, and so on. The keystream is XORed with the plaintext. Because the keystream is independent of the plaintext, a bit error in the ciphertext affects only the corresponding plaintext bit, which made OFB attractive for noisy channels.
NextSSL includes AES-128-OFB, AES-192-OFB and AES-256-OFB. OFB's keystream does not depend on the plaintext, so it can be precomputed before the data is available. If a keystream block ever repeats, the generator enters a cycle; with AES this is very unlikely for practical message lengths. OFB is rarely chosen for new protocols, which use CTR or an AEAD mode instead.
History
1980–2001AES-OFB published
Specified in NIST SP 800-38A
Security notes
OFB requires a unique IV per key; reuse exposes the XOR of plaintexts. It provides no integrity and allows targeted bit-flipping. It has no advantages over CTR for new designs.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 16 | Secret key |
| nonce | 16 | Nonce / IV |
Use it
from nextssl_demo import NextSSL
ns = NextSSL() # safe API: safe and standard tiers
ct = ns.call("stream_apply", "aes-128-ofb", None, key, nonce, b"secret")[0] # same call decrypts
nextssl_stream_apply("aes-128-ofb", NULL, key, nonce, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_streamcipher_in(reg::all(), Policy::Safe, "aes-128-ofb", &Params::new())?;
let ct = alg.apply_keystream(&key, &nonce, b"secret")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other AES-OFB variants
2Similar names
Looking for something else?More stream ciphers
All 37Frequently asked questions
What is AES-128-OFB?
AES-128-OFB is a stream cipher in the AES-OFB family. OFB (Output Feedback) is a block cipher mode defined in NIST SP 800-38A in which the block cipher is applied repeatedly to the IV to produce a keystream. It is also known as aes128-ofb.
What are the AES-128-OFB sizes?
In NextSSL, AES-128-OFB uses: key 16 bytes, nonce 16 bytes.
Who designed AES-128-OFB and when?
AES-128-OFB belongs to the AES-OFB family, first published in 1980. Its origin: NIST SP 800-38A.
Which standards define AES-128-OFB?
AES-128-OFB is referenced by NIST SP 800-38A. It is specified in a FIPS standard.
Is AES-128-OFB safe to use?
AES-128-OFB is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.
What other AES-OFB variants are there?
NextSSL also registers aes-192-ofb, aes-256-ofb in the AES-OFB family.