Graph
Initialization Vector

🧩Initialization Vector

NEW

Also known as: IV

A nonsecret per-message value that initializes encryption modes, ensuring distinct ciphertexts under the same key.

DESCRIPTION

An initialization vector (IV) seeds block cipher modes and stream constructions to ensure that encrypting identical messages with the same key yields different ciphertexts. IV requirements vary by mode: CBC needs unpredictable IVs; CTR and OFB require uniqueness (never reuse). IVs are typically transmitted alongside ciphertext and must be properly sized (e.g., block length for AES-CBC). IV misuse can catastrophically expose patterns or keystream, undermining confidentiality.

ALTERNATIVE DEFINITIONS

NIST SP 800-38A

An initialization vector (IV) is a block of bits used to initialize the state of a block cipher mode of operation; it is not required to be secret.

Clarifies nonsecret status and role in initializing modes.

Source

MDN Web Docs

The iv parameter is a non-secret initialization vector required by several algorithms to ensure distinct ciphertexts even when the same key and plaintext are used.

Emphasizes API-level use and distinctness goal.

Source

OWASP

Incorrect IV use—such as reuse or predictability—can lead to serious vulnerabilities, including disclosure of patterns or keystream reuse in stream-like modes.

Highlights misuse risks and impact on confidentiality.

Source

Counter Cipher Block Chaining AES-GCM Output Feedback Cipher Feedback Random Number Generator Entropy Salt Rijndael

COMPETING TERMS

Nonce

RELATIONS

KNOWLEDGE AREAS

Data Security Software Engineering

TARGET AUDIENCE

Security Architect Cybersecurity Engineer Software Developer DevOps Engineer Cloud Architect

EXTERNAL SOURCES

  • Wikipedia - Initialization vector
  • NIST - Formal IV requirements by mode
  • OWASP - IV best practices and pitfalls
  • MDN Web Docs - Web Crypto usage of IVs

TOP QUESTIONS

Is an Initialization Vector (IV) secret?

No. IVs are not secrets and are typically transmitted with the ciphertext. Their security role is to ensure uniqueness or unpredictability, depending on the mode.

Category: Understanding

What happens if you reuse an IV with the same key?

In CTR/OFB, keystream repeats, exposing plaintext relationships; in CBC, patterns can leak. Reuse catastrophically undermines confidentiality.

Category: Risks

How should IVs be generated for CBC?

CBC requires unpredictable IVs, typically from a cryptographically secure random number generator of block size length.

Category: BestPractices

How should IVs be generated for CTR or GCM?

They must be unique per key, often constructed from nonces and counters. GCM often uses 96-bit nonces with counters.

Category: BestPractices

Where is the IV stored or transmitted?

It’s commonly prepended to the ciphertext. Receivers read it to initialize decryption.

Category: Example

Why do some APIs call IVs ‘nonces’?

Because uniqueness is the critical property in many modes; ‘nonce’ emphasizes uniqueness, while ‘IV’ emphasizes initialization role.

Category: Understanding

Do password hashing algorithms use IVs?

They use salts, which serve a different purpose: thwarting precomputed attacks. Salts need not be unpredictable; uniqueness is key.

Category: Misunderstanding

What is the size of an IV?

It depends on the algorithm and mode, commonly the block size (e.g., 128 bits for AES-CBC) or a defined nonce size (e.g., 96 bits for GCM).

Category: Requirements

Can deterministic IVs be safe?

If mode requires uniqueness only, a deterministic construction ensuring uniqueness (e.g., counter) can be safe. Never use deterministic IVs where unpredictability is required.

Category: Opinion