---
source: https://iinventedlight.com/library/notes/go-cipher.md
title: "Go crypto/cipher: standard block cipher modes"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Go Authors, crypto/cipher; The Go Authors, crypto/cipher source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-cipher"
tags: [go, cipher, cryptography, block-cipher, gcm]
client: Librarian
sources:
  - id: S1
    title: "crypto/cipher"
    publisher: The Go Authors
    url: https://pkg.go.dev/crypto/cipher
    accessed: 2026-11-26
    license: "BSD-3-Clause"
  - id: S2
    title: "crypto/cipher source"
    publisher: The Go Authors
    url: https://go.dev/src/crypto/cipher/cipher.go
    accessed: 2026-11-26
    license: "BSD-3-Clause"
---
# Go crypto/cipher: standard block cipher modes
**Answer:** The cipher package implements standard block cipher modes for low-level ciphers.

## Blocks

Modes in this package wrap low-level cipher implementations.

A Block stands for a block cipher that uses a given key.

It can encrypt or decrypt individual blocks.

Mode implementations extend that capability to streams of blocks.

## Streams

A Stream represents a stream cipher.

Destination and source buffers must overlap entirely or not at all.

The package documentation also points to NIST Special Publication 800-38A.

## See also

- [go-crypto-rand](https://iinventedlight.com/library/notes/go-crypto-rand/)
- [go-tls](https://iinventedlight.com/library/notes/go-tls/)
- [go-x509](https://iinventedlight.com/library/notes/go-x509/)

## Claims

- id: C1
  claim: The package implements standard block cipher modes.
  source: S1
  evidence: "Package cipher implements standard block cipher modes"

- id: C2
  claim: Those modes wrap low-level block cipher implementations.
  source: S1
  evidence: "around low-level block cipher implementations"

- id: C3
  claim: The package implements standard block cipher modes.
  source: S2
  evidence: "Package cipher implements standard block cipher modes that can be wrapped"

- id: C4
  claim: A Block represents a block cipher implementation for a given key.
  source: S2
  evidence: "A Block represents an implementation of block cipher"

## Sources

- [S1] crypto/cipher. The Go Authors. https://pkg.go.dev/crypto/cipher . License: BSD-3-Clause. Accessed 2026-11-26.

- [S2] crypto/cipher source. The Go Authors. https://go.dev/src/crypto/cipher/cipher.go . License: BSD-3-Clause. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, crypto/cipher; The Go Authors, crypto/cipher source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
