AES-128-ECB
Electronic Codebook mode: each block encrypted independently, leaking plaintext patterns
Old but not broken. Kept for interoperability; root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About AES-128-ECB
AES-128-ECB is one of 3 AES-ECB variants in the NextSSL registry, a block cipher mode of operation. It uses a 16-byte (128-bit) key and a 16-byte (128-bit) block. It takes the parameter padding (default none). Its registry entry cites NIST SP 800-38A. It is also known as aes128-ecb. NextSSL lists it in the legacy tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
ECB (Electronic Codebook) is the simplest block cipher mode: every 16-byte block is encrypted independently with the same key. It is defined in NIST SP 800-38A for completeness but is unsuitable for encrypting more than one block of data.
Because identical plaintext blocks produce identical ciphertext blocks, ECB reveals the structure of the data. The classic demonstration is an encrypted bitmap image whose outline remains clearly visible. ECB also allows blocks to be reordered, removed or replayed without detection. It is only safe for single, random blocks. It needs no IV.
NextSSL includes AES-128-ECB, AES-192-ECB and AES-256-ECB. ECB is legitimately used as a building block, for example to encrypt a single random block or to implement other modes, and for compatibility with formats that mandate it. Some test suites and hardware engines expose ECB only as a primitive. Equal inputs always give equal outputs.
History
1980–2001ECB, CBC, CFB and OFB defined for DES in FIPS 81
Carried over to AES in NIST SP 800-38A
Security notes
ECB leaks equality of plaintext blocks and provides no integrity. It must not be used to encrypt messages longer than one block or any structured data. Use AES-GCM, ChaCha20-Poly1305 or another AEAD instead.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 16 | Secret key |
| nonce | 0 | Nonce / IV |
| block | 16 | Block |
Parameters
| Name | Type | Range | Default | Required |
|---|---|---|---|---|
| padding | enum | 0 – | none | no |
Parameters are passed as a string, for example nextssl_mac("hmac", "hash=sha512", …). Omitted parameters take their declared default.
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'legacy' is reachable from the root API only
ct = root.call("blockmode_encrypt", "aes-128-ecb", None, key, iv, data)[0]
pt = root.call("blockmode_decrypt", "aes-128-ecb", None, key, iv, ct)[0]
nextssl_root_blockmode_encrypt("aes-128-ecb", NULL, key, iv, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_blockmode_in(reg::all(), Policy::Any, "aes-128-ecb", &Params::new())?;
let ct = alg.encrypt(&key, &iv, &data)?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other AES-ECB variants
2Similar names
Looking for something else?More block cipher modes
All 20Frequently asked questions
What is AES-128-ECB?
AES-128-ECB is a block mode in the AES-ECB family. ECB (Electronic Codebook) is the simplest block cipher mode: every 16-byte block is encrypted independently with the same key. It is also known as aes128-ecb.
What are the AES-128-ECB sizes?
In NextSSL, AES-128-ECB uses: key 16 bytes, nonce 0 bytes, block 16 bytes.
Who designed AES-128-ECB and when?
AES-128-ECB belongs to the AES-ECB family, first published in 1980. Its origin: NIST SP 800-38A.
Which standards define AES-128-ECB?
AES-128-ECB is referenced by NIST SP 800-38A. It is specified in a FIPS standard.
Is AES-128-ECB safe to use?
AES-128-ECB is in the legacy tier. Old but not broken. Kept for interoperability; root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other AES-ECB variants are there?
NextSSL also registers aes-192-ecb, aes-256-ecb in the AES-ECB family.