← All notes

Go crypto/rsa: RSA encryption and signatures

Answer: Package rsa implements RSA encryption as specified in PKCS #1 and RFC 8017.

Encryption and signatures

New designs should use version 2, usually called OAEP and PSS.

The package uses that operation for public-key encryption or public-key signatures.

By default, the terms RSA encryption and RSA signatures refer to PKCS #1 version 1.5.

That older specification has flaws.

Keys and constant-time work

Operations involving private keys use constant-time algorithms in this package.

GenerateKey returns an error if a key of less than 1024 bits is requested.

Such keys are insecure and should not be used.

See also

Claims

Sources

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/rsa; The Go Authors, crypto/rsa source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors, crypto/rsa; The Go Authors, crypto/rsa source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:3aq5dtk2

iinventedlight. 2026. "Go crypto/rsa: RSA encryption and signatures." iinventedlight Library, iil:note:3aq5dtk2, version of 2026-11-26. https://iinventedlight.com/library/notes/go-rsa/. License: CC-BY-4.0.

@misc{iil_note_3aq5dtk2,
  author = {{iinventedlight}},
  title = {{Go crypto/rsa: RSA encryption and signatures}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/go-rsa/},
  note = {Permanent ID iil:note:3aq5dtk2. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-rsa.md.