# Code to Image

> Turn code, configuration or terminal output into a highlighted image for slides, tickets and documents: SVG with real, selectable text, PNG at 1x and 2x, and alt text to paste beside it. A secrets check masks the private keys, tokens and passwords it finds before you export. Runs in your browser.

- Tool: https://ronutz.com/en/tools/code-to-image
- Family: Text & utilities

---

## What it does

Paste code, configuration or terminal output and get a picture of it for a slide, a ticket or a document: an SVG that keeps the code as real, selectable text, and a PNG at 1x or 2x, with alt text ready to paste beside it. You choose the language for highlighting, a dark or a light palette, the font size, the tab stops, line numbers, a window-style frame with an optional title, the padding, and the lines to highlight.

Before any picture is made, a secrets check looks for values you may not mean to publish, such as private keys, Authorization headers, AWS access key IDs, JWTs, passwords in URLs, FortiOS `ENC` values and password or secret attributes. Every finding is listed and masked in the picture unless you untick it. Everything runs in your browser.

Where the place you are writing in can show text, prefer text. [WCAG 2.2](https://www.w3.org/TR/WCAG22/) Success Criterion 1.4.5, Images of Text, asks for text rather than images of text whenever the technology can present it; a fenced code block in a wiki, a knowledge base or a ticket system that renders one is text, and the reader can copy it. This tool is for the places that cannot show it, and the alt text it writes is the code itself. [Code on slides and in tickets](https://ronutz.com/en/learn/code-on-slides-and-in-tickets) goes through that choice, the alt text, the contrast and the secrets a screenshot keeps.

## Languages

Highlighting only: nothing is parsed, validated or run, and code that is not valid in the chosen language is still drawn, coloured as far as the rules below reach. Each language's rules come from its own reference, read on 2026-10-27.

| Language | What is coloured | Reference |
|---|---|---|
| Plain text | Nothing | |
| Shell (POSIX sh) | `#` comments only where a word could start (so `a#b` is not one); single, double and dollar-single quotes; `$name`, `${...}`, `$1`, `$@` and the other special parameters, live inside double quotes; the reserved words `if then else elif fi do done case esac while until for in` where they are reserved; the name of an assignment such as `LOG=...`; whole-number words | [POSIX.1-2024 Shell Command Language](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html), sections 2.2 to 2.6 |
| Python | `#` comments; strings with every prefix (`b`, `r`, `u`, `f`, `t` and the `r` combinations, any case), triple-quoted strings across lines; the 35 keywords; the soft keywords `match`, `case`, `type` and `lazy` when they open a statement; integer, float and imaginary literals with underscores and `0x`, `0o`, `0b` | [Python 3.15 Lexical analysis](https://docs.python.org/3/reference/lexical_analysis.html), the current bugfix release (end of life 2031-10, [Status of Python versions](https://devguide.python.org/versions/)) |
| JSON | member names (a string followed by `:`) as keys; strings; numbers; `true`, `false`, `null`. JSON has no comments, so `//` is not coloured | [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259) |
| YAML | `#` comments after white space; `%` directives; `---` and `...`; mapping keys; double- and single-quoted scalars, also across lines; anchors, aliases and tags; the core schema's null, booleans, integers and floats; the content of `\|` and `>` block scalars | [YAML 1.2.2](https://yaml.org/spec/1.2.2/), sections 5.3, 6.6, 6.8, 6.9, 7.3, 8.1, 9.1.2 and 10.3.2 |
| Tcl, iRules, Expect | `#` comments only where a command starts (so `;#` after a command is one); double-quoted words with live `$` and `[...]`; `$name`, `${name}`, `$name(index)`; the first word of a command when it is a Tcl built-in, `when` or an Expect command; `then`, `elseif`, `else`; numbers as `expr` reads them; the event name after `when`. Braced words are coloured as scripts, because the bodies of `proc`, `if`, `when` and `expect` are scripts | [Tcl 9.0 Tcl(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/Tcl.html), [expr(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/expr.html), [if(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/if.html); iRules are [based on Tcl](https://clouddocs.f5.com/api/irules/WhatIsAnIRule.html) and begin with [`when`](https://clouddocs.f5.com/api/irules/when.html); Expect's commands from [expect(1)](https://www.tcl-lang.org/man/expect5.31/expect.1.html) |
| F5 tmsh | prompts; `#` comments at the start of a word; quoted strings; the commands and the root modules (`auth cli gtm ltm net sys wom`) outside braces; attribute names at the start of a line inside an object; addresses and numbers | [TMSH Reference v17](https://clouddocs.f5.com/cli/tmsh-reference/latest/general/tmsh.html) and its [commands](https://clouddocs.f5.com/cli/tmsh-reference/latest/commands/index.html) |
| FortiOS CLI | prompts; a line that starts with `#` and is not a prompt (such as a backup's first line); single- and double-quoted strings with `\'`, `\"` and `\\`; `config`, `edit`, `set`, `unset`, `next`, `end` and the other commands; the field name after `set`; `ENC`; `$USERFROM`, `$USERNAME`, `$SerialNum`; addresses and numbers | [FortiOS 7.6.8 CLI basics](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/896276/cli-basics), [Command syntax](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/508024/command-syntax), [Subcommands](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/627485/subcommands) |
| Cisco-style CLI | prompts (`Router>`, `Router#`, `Router(config)#`, `Router(config-if)#`, with or without a space after them); `!` comments; `no` and `default` and a few documented commands at the start of a line; addresses, masks and numbers. Cisco's CLI has no general quoting rule, so nothing is coloured as a string | [IOS XE 17.x Managing Configuration Files](https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cm-config-files-0.html) ("Precede a comment with an exclamation point"), [Using the Cisco IOS Command-Line Interface](https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cf-cli-basics.html), [Catalyst 8400: Using Cisco IOS XE Software](https://www.cisco.com/c/en/us/td/docs/routers/c8400/c8400-software-config-guide/Using-Cisco-IOS-XE-software.html) |

What the highlighters do not do: shell here-documents, nested command substitutions inside double quotes, Python f-string replacement fields (the whole f-string is coloured as a string), YAML flow scalars across lines, and anything that needs a parser rather than a scanner.

### Terminal sessions

For the shell, Python and Tcl, a text in which any line starts with that language's prompt is read as a session. The prompts are `$ ` (the default of POSIX `PS1`) and the BIG-IP bash prompt `[root@bigip-1:Active:Standalone] config # ` for the shell, `>>> ` and `... ` (Python's `sys.ps1` and `sys.ps2`) for Python, and `% ` (tclsh) for Tcl. Lines with a prompt are highlighted as commands, joined to the next prompt line so a string can continue, and the lines without a prompt are command output, left uncoloured, so an apostrophe in the output opens no string. The page says when it read the text this way.

For tmsh, FortiOS and Cisco-style CLI the prompts are coloured and every line is highlighted, because their output is usually configuration.

## The secrets check

It runs on the text whatever language you chose, before anything is drawn. Each rule is taken from the documentation of the format it looks for:

| Rule | What it looks for | What is masked | Source |
|---|---|---|---|
| PEM private key | a `-----BEGIN ... PRIVATE KEY-----` block: `PRIVATE KEY`, `ENCRYPTED PRIVATE KEY`, OpenSSL's traditional `RSA PRIVATE KEY` (with `Proc-Type` and `DEK-Info` headers) and `OPENSSH PRIVATE KEY`; also a block written on one line with `\n` escapes | every line between the boundaries (the boundary lines stay); without an END line, the lines that look like base64 | [RFC 7468](https://www.rfc-editor.org/rfc/rfc7468) sections 2, 3, 10, 11; [OpenSSL 3.5 PEM_read_bio_PrivateKey](https://docs.openssl.org/3.5/man3/PEM_read_bio_PrivateKey/); [OpenSSH sshkey.c](https://github.com/openssh/openssh-portable/blob/master/sshkey.c) |
| Authorization header | `Authorization:` or `Proxy-Authorization:` with `Bearer` or `Basic`, in any case | the credentials | [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110) 5.1, 11.1, 11.4, 11.6.2; [RFC 6750](https://www.rfc-editor.org/rfc/rfc6750) 2.1; [RFC 7617](https://www.rfc-editor.org/rfc/rfc7617) 2 |
| AWS access key ID | `AKIA` (access key) or `ASIA` (temporary STS key) and 16 upper-case letters or digits, not inside a longer word | the ID | [IAM identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html); [access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) |
| JWT | three (JWS) or five (JWE) base64url segments joined by dots whose first segment decodes to a JSON object with `alg` | the token | [RFC 7515](https://www.rfc-editor.org/rfc/rfc7515) 2, 4.1.1, 7.1; [RFC 7516](https://www.rfc-editor.org/rfc/rfc7516) 4.1.1, 7.1; [RFC 7519](https://www.rfc-editor.org/rfc/rfc7519) 1 |
| Password in a URL | `scheme://user:password@` | the password | [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) 3.2.1 |
| FortiOS encrypted value | `set <field> ENC <value>` | the value | [Fortinet technical tip](https://community.fortinet.com/fortigate-3/technical-tip-command-fail-while-copying-the-preshare-key-from-another-configuration-214348) (`set psksecret ENC ...`) |
| set command | `set <name> <value>` with a secret-looking name: FortiOS fields and Tcl variables (Expect scripts, iRules) | the value, inside its quotes or braces | [FortiOS Subcommands](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/627485/subcommands); [Tcl set(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/set.html) |
| password, passphrase or secret attribute | tmsh `password`, `passphrase`, `encrypted-password`, `proxy-ca-passphrase`; Cisco `password` and `secret` with an optional type digit | the value | tmsh [auth user](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/auth/auth_user.html), [sys file ssl-key](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/sys/sys_file_ssl-key.html), [ltm profile client-ssl](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/ltm/ltm_profile_client-ssl.html), [ltm monitor http](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/ltm/ltm_monitor_http.html); [Cisco IOS XE 17.18 passwords](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/sec/b_1718_sec_9300_cg/controlling_switch_access_with_passwords_and_privilege_levels.html) |
| JSON member | `"name": "value"` with a secret-looking name | the value | [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259) 4, 7; [RFC 6749](https://www.rfc-editor.org/rfc/rfc6749) 5.1 (`access_token`, `refresh_token`) |
| YAML key | `name: value`, block or flow, with a secret-looking name | the value | [YAML 1.2.2](https://yaml.org/spec/1.2.2/) 7.3, 7.4, 8.2.2 |
| Shell assignment | `NAME=value` with a secret-looking name, also in a URL's query string | the value | [POSIX](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html) 2.10.2; the [AWS CLI credentials file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) uses the same shape |
| Assignment | `name = "string"` (Python, and TOML- or INI-style files) with a secret-looking name | the string's content | [Python 3.15 assignment statements](https://docs.python.org/3/reference/simple_stmts.html) |

**A secret-looking name** is this tool's own rule, not a standard: the last word of the name (split at underscores, hyphens, dots and camelCase) is password, passwd, pass, passphrase, secret, token, psk, psksecret, apikey, accesskey, secretkey, privatekey, credential or credentials, or the name ends in key after api, access, private, secret, signing, client, auth, encryption, master or session. So `DB_PASSWORD`, `client_secret`, `refresh_token`, `apiKey` and `aws_secret_access_key` are secret-looking, and `password_file`, `token_type`, `sort_key` and `PWD` (the shell's working directory) are not.

**Not reported:** an empty value; a placeholder or setting (`none`, `null`, `true`, `false`, `enable`, `disable` and the like); a reference that stands for the value, such as `$VAR`, `${VAR}`, `$(cmd)`, `$env(PW)`, a Tcl `[command]`, `{{ template }}` or `<placeholder>`; a value already masked with `*`, `x` or bullets; a value without any letter or digit. A crypt-style hash such as `$6$salt$hash` or Cisco's `$9$...` is not a reference and is reported. A password, passphrase or secret attribute inside a comment is not reported, because comments use those words in prose; every other rule also looks inside comments. When two rules find the same characters, the more specific one is kept (a JWT in a Bearer header is one finding).

**Masking.** A masked value is replaced by eight bullets, whatever its length, so the picture does not show how long it was. The characters themselves are replaced, not covered: they are in neither the SVG's text, nor the PNG, nor the alt text, where the value reads "[masked]". Untick a finding to show it as written; the choice is remembered by rule, line and column while you edit elsewhere.

**It is not a complete scanner.** It knows the formats above and nothing else, it cannot tell a real secret from an example, and a secret it does not look for stays in the picture. Read the picture before you publish it.

The session secrets in `openssl s_client` output are one example: no rule looks for them, so a TLS 1.3 `Resumption PSK:` line is drawn as printed, and a TLS 1.2 `Master-Key:` line is masked only because it has the shape of a YAML key with a secret-looking name. The [openssl s_client explainer](https://ronutz.com/en/tools/openssl-s-client-explainer) lists both among its findings.

## How the picture is made

The engine lays the picture out once (every rectangle, dot and run of text with its position and colour) and both files come from that layout, so they cannot disagree.

- **Font and grid.** JetBrains Mono, the site's monospace font, under the [SIL Open Font License 1.1](https://openfontlicense.org/open-font-license-official-text/). Its metrics, read from the font file: 1000 units per em, every character 600 units wide, ascender 1020, descender 300. A column is 0.6 times the font size, a line is 1.5 times the font size rounded to a whole pixel, and the text sits in the middle of its line. One column per code point: tabs expand to the stops you choose, and characters that are wider in some fonts (many East Asian characters and emoji) still take one column, so they may overlap their neighbour.
- **The SVG** keeps every line as one `<text>` element of real text, coloured with `<tspan>` elements, and gives each character its own x position: [SVG 2](https://www.w3.org/TR/SVG2/text.html) applies the nth x value to the nth character, counted in code points, so the columns hold even in a fallback font. It names the font (`'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', monospace`) and does not embed it; where JetBrains Mono is not installed, the viewer's monospace font draws the same columns. White space is kept (`xml:space="preserve"` and `white-space: pre`), programming ligatures are off, the document has a `<title>` with the description and `role="img"`, and line numbers are separate elements so a selection of the code does not pick them up. Characters an XML document cannot hold ([XML 1.0](https://www.w3.org/TR/xml/) production [2]: control characters other than tab and line feed, lone surrogates, U+FFFE and U+FFFF) are replaced with U+FFFD first.
- **The PNG** is drawn on a canvas in your browser at 1x or 2x the CSS pixels, character by character on the same grid, with the page's own copy of JetBrains Mono. Very large pictures can exceed what a browser allows a canvas to be; the page then says so and the SVG still works.
- **Copying the PNG** uses `ClipboardItem`, where the browser has it; `image/png` is one of the data types the [Clipboard API](https://www.w3.org/TR/clipboard-apis/) requires for writing.

Nothing is loaded from or sent to anywhere. The preview is inline SVG built from the layout, and the downloads are files made in the page.

## Palettes and contrast

Both palettes are measured with WCAG 2.2's own formulas (relative luminance with the 0.04045 threshold, contrast ratio (L1 + 0.05) / (L2 + 0.05)). Every text colour, the line numbers and the window title meet Success Criterion 1.4.3's 4.5:1 against every background they can sit on: the code background and the highlighted-line band (the title against the title bar). The marker at the left of a highlighted line is a graphical object and meets 1.4.11's 3:1. The three window dots are decoration. Ratios are rounded down, so a pass is never rounded up.

| Text | Light: on background `#ffffff` | Light: on highlight `#fff3c4` | Dark: on background `#11151c` | Dark: on highlight `#26303d` |
|---|---|---|---|---|
| Plain | `#1f2328` 15.79 | 14.19 | `#e6e9ef` 15.04 | 10.97 |
| Comment | `#57606a` 6.38 | 5.74 | `#9ba6b2` 7.39 | 5.39 |
| String | `#0a6629` 7.12 | 6.40 | `#9ddba0` 11.38 | 8.31 |
| Number | `#0550ae` 7.59 | 6.82 | `#8fc6ff` 10.18 | 7.43 |
| Keyword | `#a40e26` 7.86 | 7.06 | `#ff9c94` 9.09 | 6.63 |
| Variable | `#8a4600` 7.10 | 6.38 | `#f6bd84` 10.91 | 7.96 |
| Prompt | `#0b6874` 6.46 | 5.81 | `#7fd8d0` 11.00 | 8.03 |
| Key | `#6639ba` 7.34 | 6.59 | `#c9b0ff` 9.70 | 7.08 |
| Masked value | `#9c1c6f` 7.47 | 6.71 | `#ff8fd0` 8.79 | 6.41 |
| Line number | `#5f6872` 5.66 | 5.08 | `#97a1ad` 6.98 | 5.09 |

Window title on the title bar: light `#3a424a` on `#eceff3`, 8.84; dark `#c3cbd4` on `#1d232c`, 9.64. Highlight marker (3:1 required): light `#9a6700`, 4.86 on the background and 4.37 on the highlight; dark `#e3b341`, 9.40 and 6.86.

## Alt text

The alt text is a one-line description (how many lines, which language, how many values masked), a blank line, then the code as plain text with every masked value written as "[masked]". That follows Success Criterion 1.1.1, Non-text Content: the text alternative of a picture of code serves the same purpose when it is the code. Where the alt text would be long, put the code as text next to the picture (on a slide, in the speaker notes) and keep only the description as alt text.

## Options

- **Language**: the highlighter (see the table above).
- **Palette**: dark (the default) or light.
- **Font size**: 12, 14, 16 (the default), 18, 20, 24 or 28 CSS pixels.
- **Tab stops**: every 2, 4 (the default) or 8 columns.
- **Padding**: 16, 32 (the default), 48 or 64 CSS pixels around the window, or around the code without a frame.
- **Line numbers**: on by default.
- **Window frame**: on by default, with three decorative dots and an optional title of up to 80 characters.
- **Highlight lines**: numbers and ranges separated by commas or spaces, such as `3, 5-7`. A token that is not a number or a range, zero or a backwards range is ignored, and a range past the last line is kept up to the last line; the page lists what it ignored.

## Limits and what changes

The tool refuses, with the reason, text longer than 50,000 characters, more than 400 lines, a line wider than 400 columns once tabs are expanded, a title longer than 80 characters and a highlight list longer than 200 characters. These keep the picture inside what a slide or a ticket can use and inside what browsers can draw.

It tells you when it has removed a byte order mark, read carriage returns as line breaks, replaced characters XML cannot hold, expanded tabs, trimmed spaces at the ends of lines (they would only widen the picture), or read the text as a terminal session. One final line break makes no extra line.

## Worked example

The Example button loads a FortiOS IPsec phase 1 whose pre-shared key is in the encrypted `ENC` form, written for this example (base64 of "for-demo-only-not-a-real-key"), with the documentation address 203.0.113.10 from [RFC 5737](https://www.rfc-editor.org/rfc/rfc5737):

```
config vpn ipsec phase1-interface
    edit "to-branch-01"
        set interface "port1"
        set peertype any
        set proposal aes256-sha256
        set remote-gw 203.0.113.10
        set psksecret ENC Zm9yLWRlbW8tb25seS1ub3QtYS1yZWFsLWtleQ==
    next
end
```

The secrets check reports one finding, "FortiOS encrypted value (ENC), line 7, column 27", and the picture shows `set psksecret ENC ••••••••` on line 7, which the Example also highlights, under the title "VPN to branch 01" (VPN: virtual private network). The SVG is 451.2 by 348 CSS pixels in the dark palette, and the alt text begins "Code image: 9 lines of FortiOS CLI, 1 value masked".

## Share results

Under the export buttons, **Share results** builds a link to this page, only when you press it, that carries three things after the `#`: the text as the picture shows it, with every value the secrets check masked replaced by the same eight bullets, the highlighting language and the palette. The window title (free text the secrets check does not read), the highlighted lines, the font size, the padding, the tab stops and the two switches are not carried. A value you unticked is in the link as you typed it, and the popover names each such value by its line and label before you copy anything; when nothing is unticked it says that every value found is masked. [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) (section 3.5) has the fragment "separated from the rest of the URI prior to a dereference", so the text is not sent to the server when the link is opened; it stays in the address bar and history of whoever opens it.

- **How long.** At most 16,384 characters of text, the bound the site uses for every value after the `#`; a longer text gets no link, and the popover says so.
- **Opening a link.** The text fills the box as a paste would, the language and the palette are set, and the picture is drawn; the receiving page's own other choices stay as they are. A masked value arrives as eight bullets: on some lines the secrets check finds them again and masks them again, on others it draws them as ordinary characters, so the description may count fewer masked values, but no value is there to reveal. A language or a palette the tool does not offer makes the whole link ignored. Either way the values leave the page's address at once, without a request.

## Provenance

The behaviour is pinned by the golden vector set `code-to-image-golden-2026-10-27b`: the colouring of every language (plain, shell script and session, Python script and session, JSON, YAML, an iRule, an Expect script, a tclsh session, tmsh, FortiOS, Cisco-style), three SVG documents byte for byte with their alt text (each checked as well-formed XML and for one x position per character), every secrets rule positive and negative with the exact characters masked (and checked absent from the SVG and the alt text when masked), every limit at and past its value, the normalization, the notes, the highlight parser, and every contrast ratio above, whose luminance is also compared with the site's [colour contrast tool](https://ronutz.com/en/tools/color-contrast-format), and the text a Share results link carries for seven inputs, byte for byte, with the check that the receiving page draws the same characters and that no masked value is in the link.

## API

Not exposed over the API, on purpose. The PNG is drawn by the reader's browser, and the input is the kind of text that holds secrets: configuration, captures and scripts are exactly what the secrets check exists for, and the safe place to check them is the machine they are already on. Sending them to a server to be checked would defeat the check.

## Sources

All read 2026-10-27.

- [The Open Group Base Specifications Issue 8 (POSIX.1-2024), Shell Command Language](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html)
- [Python 3.15: Lexical analysis](https://docs.python.org/3/reference/lexical_analysis.html), [sys.ps1 and sys.ps2](https://docs.python.org/3/library/sys.html), [assignment statements](https://docs.python.org/3/reference/simple_stmts.html), [Status of Python versions](https://devguide.python.org/versions/)
- [RFC 8259, JSON](https://www.rfc-editor.org/rfc/rfc8259)
- [YAML 1.2.2](https://yaml.org/spec/1.2.2/)
- [Tcl 9.0: Tcl(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/Tcl.html), [expr(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/expr.html), [if(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/if.html), [set(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/set.html), [tclsh(1)](https://www.tcl-lang.org/man/tcl9.0/UserCmd/tclsh.html), [the command index](https://www.tcl-lang.org/man/tcl9.0/TclCmd/index.html), [the releases](https://www.tcl-lang.org/software/tcltk/)
- [F5 iRules: What Is An iRule](https://clouddocs.f5.com/api/irules/WhatIsAnIRule.html) and [when](https://clouddocs.f5.com/api/irules/when.html); [expect(1)](https://www.tcl-lang.org/man/expect5.31/expect.1.html)
- [F5 TMSH Reference v17](https://clouddocs.f5.com/cli/tmsh-reference/latest/) (tmsh, the commands index, the 17.0.0 PDF, auth user, sys file ssl-key, ltm profile client-ssl, ltm monitor http). F5's software support policy, [K5903](https://my.f5.com/manage/s/article/K5903) (read 2026-10-27), gives the 17.x Long-Term Stability Releases Standard Support until 31 March 2027 (17.1.x) and 1 January 2029 (17.5.x).
- [FortiOS 7.6.8 Administration Guide](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/896276/cli-basics) (CLI basics, Command syntax, Subcommands, Trusted platform module support), [CLI Reference: config system admin](https://docs.fortinet.com/document/fortigate/7.6.8/cli-reference/390485493/config-system-admin), the Fortinet technical tips on [copying a pre-shared key](https://community.fortinet.com/fortigate-3/technical-tip-command-fail-while-copying-the-preshare-key-from-another-configuration-214348) and on [the end of support of FortiOS 7.4 and 7.6](https://community.fortinet.com/fortigate-3/technical-tip-fortios-end-of-support-change-for-fortios-v7-4-and-v7-6-224876) (7.6: end of engineering support 25 July 2028, end of support 25 January 2030)
- Cisco IOS XE 17.x System Management Configuration Guide: [Managing Configuration Files](https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cm-config-files-0.html) and [Using the Cisco IOS Command-Line Interface](https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cf-cli-basics.html); [Catalyst 8400: Using Cisco IOS XE Software](https://www.cisco.com/c/en/us/td/docs/routers/c8400/c8400-software-config-guide/Using-Cisco-IOS-XE-software.html); [IOS XE 17.18 passwords](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/sec/b_1718_sec_9300_cg/controlling_switch_access_with_passwords_and_privilege_levels.html); [the IOS XE software lifecycle statement](https://www.cisco.com/c/en/us/products/collateral/ios-nx-os-software/ios-xe-26/bulletin-c25-2378701.html)
- [RFC 7468](https://www.rfc-editor.org/rfc/rfc7468), [OpenSSL 3.5 PEM_read_bio_PrivateKey](https://docs.openssl.org/3.5/man3/PEM_read_bio_PrivateKey/) (3.5 is OpenSSL's long-term-support release, supported until 2030-04-08 per its [release strategy](https://openssl-library.org/policies/releasestrat/)), [OpenSSH sshkey.c](https://github.com/openssh/openssh-portable/blob/master/sshkey.c)
- [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110), [RFC 6750](https://www.rfc-editor.org/rfc/rfc6750), [RFC 7617](https://www.rfc-editor.org/rfc/rfc7617), [RFC 6749](https://www.rfc-editor.org/rfc/rfc6749)
- AWS: [IAM identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html), [access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html), [CLI configuration and credential files](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
- [RFC 7519](https://www.rfc-editor.org/rfc/rfc7519), [RFC 7515](https://www.rfc-editor.org/rfc/rfc7515), [RFC 7516](https://www.rfc-editor.org/rfc/rfc7516), [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), [RFC 5737](https://www.rfc-editor.org/rfc/rfc5737)
- [WCAG 2.2](https://www.w3.org/TR/WCAG22/), [Understanding 1.4.5 Images of Text](https://www.w3.org/WAI/WCAG22/Understanding/images-of-text.html), [Understanding 1.4.3 Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)
- [SVG 2, Text](https://www.w3.org/TR/SVG2/text.html), [XML 1.0 (Fifth Edition)](https://www.w3.org/TR/xml/), [Clipboard API and events](https://www.w3.org/TR/clipboard-apis/), [Content Security Policy Level 3](https://www.w3.org/TR/CSP3/)
- [SIL Open Font License 1.1](https://openfontlicense.org/open-font-license-official-text/), and the LICENSE file of the @fontsource/jetbrains-mono 5.2.8 package (Copyright 2020 The JetBrains Mono Project Authors)
- [RFC 3986, Uniform Resource Identifier (URI): Generic Syntax](https://www.rfc-editor.org/rfc/rfc3986) (read 2026-10-27): section 3.5, the fragment, which carries a Share results link's values

## Standards and references

- [The Open Group Base Specifications Issue 8 (IEEE Std 1003.1-2024): Shell Command Language, sections 2.2 to 2.6 and 2.10](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html) - quoting including dollar-single-quotes (2.2.1 to 2.2.4); "#" starts a comment only where a word could start (2.3); reserved words and where they are recognised (2.4); special parameters (2.5.2); PS1 defaults to "$ " and PS2 to "> " (2.5.3); parameter expansion (2.6.2); assignment words (2.10.2)
- [Python 3.15 documentation: The Python Language Reference, 2. Lexical analysis](https://docs.python.org/3/reference/lexical_analysis.html) - comments (2.1.3); the 35 keywords (2.3.1); soft keywords match, case, _, type and lazy (2.3.2); string prefixes b, r, u, f, t and the r combinations, triple quotes, escapes (2.5); integer, float and imaginary literals with underscores (2.6)
- [Python 3.15 documentation: sys, sys.ps1 and sys.ps2](https://docs.python.org/3/library/sys.html) - the interactive prompts' initial values ">>> " and "... "
- [Python 3.15 documentation: The Python Language Reference, 7.2 Assignment statements](https://docs.python.org/3/reference/simple_stmts.html) - assignment and annotated assignment statements, the shape of the assignment rule of the secrets check
- [Python Developer's Guide: Status of Python versions](https://devguide.python.org/versions/) - 3.15 is a bugfix release, first released 2026-10-09, end of life 2031-10; docs.python.org/3 served 3.15.2 on the day
- [RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format, December 2017](https://www.rfc-editor.org/rfc/rfc8259.txt) - structural characters and literal names (2, 3), member names (4), numbers (6), strings without raw line breaks (7); JSON has no comments
- [YAML Ain't Markup Language version 1.2.2, revision of 2021-10-01](https://yaml.org/spec/1.2.2/) - indicators (5.3); comments must be separated from other tokens by white space (6.6); directives (6.8); tags and anchors (6.9); quoted and plain scalars (7.3); block scalars (8.1); document markers (9.1.2); the core schema's null, boolean, integer and float forms (10.3.2)
- [Tcl 9.0.4 manual: Tcl(n), the twelve rules of the language](https://www.tcl-lang.org/man/tcl9.0/TclCmd/Tcl.html) - commands and separators [1], words [3], double quotes [4], argument expansion [5], braces [6], command substitution [7], variable substitution $name, $name(index), ${name} [8], backslashes [9], "#" comments only where a command starts [10]; the 8.6 page states the same comment rule and 9.1's page is the same text
- [Tcl 9.0.4 manual: expr(n), operands](https://www.tcl-lang.org/man/tcl9.0/TclCmd/expr.html) - numeric operands: 0d, 0b, 0o, 0x prefixes, floats, underscores between digits
- [Tcl 9.0.4 manual: if(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/if.html) - the words then, elseif and else
- [Tcl 9.0.4 manual: set(n)](https://www.tcl-lang.org/man/tcl9.0/TclCmd/set.html) - set varName ?value?, the shape of the set-secret rule
- [Tcl 9.0.4 manual: tclsh(1), PROMPTS](https://www.tcl-lang.org/man/tcl9.0/UserCmd/tclsh.html) - the interactive prompt "% "
- [Tcl 9.0.4 manual: Tcl Commands index](https://www.tcl-lang.org/man/tcl9.0/TclCmd/index.html) - the built-in command names coloured as keywords when they open a command
- [Tcl Developer Xchange: Tcl/Tk Software and Tcl/Tk 9.1 pages](https://www.tcl-lang.org/software/tcltk/) - latest releases 9.1.0, 9.0.4 and 8.6.18; 9.1 is described as "the current development work", so the stable 9.0 pages are the basis
- [F5 clouddocs, iRules: What Is An iRule](https://clouddocs.f5.com/api/irules/WhatIsAnIRule.html) - iRule syntax "is based on the Tool Command Language (Tcl)", so the Tcl highlighter covers iRules
- [F5 clouddocs, iRules: when](https://clouddocs.f5.com/api/irules/when.html) - every iRule begins with when <event_name>; the event name is coloured as a key
- [expect(1), the Expect manual page, at tcl-lang.org](https://www.tcl-lang.org/man/expect5.31/expect.1.html) - Expect scripts are Tcl; spawn, expect, send, interact, exp_continue, expect_after, expect_before, log_user and the other commands coloured as keywords
- [F5 TMSH Reference v17: tmsh(1)](https://clouddocs.f5.com/cli/tmsh-reference/latest/general/tmsh.html) - root modules auth, cli, gtm, ltm, net, sys, wom; the (tmos)# and (tmos.ltm)# prompts; quoting with quotation marks, apostrophes or a backslash; commands separated by semicolons; tmsh scripts are Tcl. "latest" serves the v17 reference, the newest F5 publishes
- [F5 TMSH Reference v17: Commands index](https://clouddocs.f5.com/cli/tmsh-reference/latest/commands/index.html) - the command names coloured as keywords
- [F5 TMSH Reference 17.0.0 (the full PDF linked from the reference's index)](https://clouddocs.f5.com/cli/tmsh-reference/latest/_downloads/dff789d01119c67e4c9d00d212399967/tmsh_17.0.0.pdf) - "#" comments in the reference's own tmsh syntax examples (ltm policy); the BIG-IP bash prompt [root@bigip-1:Active:Standalone] config #
- [F5 TMSH Reference v17: auth user](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/auth/auth_user.html) - the password and encrypted-password attributes
- [F5 TMSH Reference v17: sys file ssl-key](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/sys/sys_file_ssl-key.html) - the passphrase attribute; source-path ftp://username:password@server/... (a password in a URL)
- [F5 TMSH Reference v17: ltm profile client-ssl](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/ltm/ltm_profile_client-ssl.html) - the passphrase and proxy-ca-passphrase attributes
- [F5 TMSH Reference v17: ltm monitor http](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/ltm/ltm_monitor_http.html) - the password attribute
- [Fortinet FortiOS 7.6.8 Administration Guide: CLI basics](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/896276/cli-basics) - special characters: < > ( ) # ' and " cannot be used in most commands; single or double quotes and the escapes \' \" \\ and backslash-space; the $USERFROM, $USERNAME and $SerialNum variables; the first line of a configuration file
- [Fortinet FortiOS 7.6.8 Administration Guide: Command syntax](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/508024/command-syntax) - commands, next and end
- [Fortinet FortiOS 7.6.8 Administration Guide: Subcommands](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/627485/subcommands) - config, edit, delete, purge, move, clone, rename, get, show, end, set <field> <value>, unset, select, unselect, append; the (admin)# and (27) # prompts
- [Fortinet FortiOS 7.6.8 CLI Reference: config system admin](https://docs.fortinet.com/document/fortigate/7.6.8/cli-reference/390485493/config-system-admin) - the password field
- [Fortinet FortiOS 7.6.8 Administration Guide: Trusted platform module support](https://docs.fortinet.com/document/fortigate/7.6.8/administration-guide/893277) - private data encryption: the passwords and keys a configuration holds encrypted (IPsec pre-shared keys, local certificates' private keys, user passwords, SNMP ...); "# " as the prompt in its examples
- [Fortinet Community, Technical Tip: Command fail while copying the preshare key from another configuration](https://community.fortinet.com/fortigate-3/technical-tip-command-fail-while-copying-the-preshare-key-from-another-configuration-214348) - set psksecret ENC <value>: the encrypted form in a configuration file
- [Fortinet Community, Technical Tip: FortiOS end of support change for FortiOS v7.4 and v7.6](https://community.fortinet.com/fortigate-3/technical-tip-fortios-end-of-support-change-for-fortios-v7-4-and-v7-6-224876) - FortiOS 7.6: End of Engineering Support 25 Jul 2028, End of Support 25 Jan 2030 (CSB-260330-1); the Life Cycle page itself needs a login and was not read
- [Cisco IOS XE 17.x System Management Configuration Guide: Managing Configuration Files](https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cm-config-files-0.html) - "Precede a comment with an exclamation point (!)"; comments are not stored in NVRAM
- [Cisco IOS XE 17.x System Management Configuration Guide: Using the Cisco IOS Command-Line Interface](https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cf-cli-basics.html) - command modes and prompts, configure terminal, the no and default forms
- [Cisco Catalyst 8400 Series Software Configuration Guide: Using Cisco IOS XE Software](https://www.cisco.com/c/en/us/td/docs/routers/c8400/c8400-software-config-guide/Using-Cisco-IOS-XE-software.html) - the table of modes with their prompts Router>, Router#, Router(config)#, Router(config-if)#; enable, interface, ip address, copy, show
- [Cisco Security Configuration Guide, IOS XE 17.18.x (Catalyst 9300): Controlling Switch Access with Passwords and Privilege Levels](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/sec/b_1718_sec_9300_cg/controlling_switch_access_with_passwords_and_privilege_levels.html) - enable secret, enable password, username ... secret 5 / secret 9 with the type digit; the guide's own type 5 example; type 0, 6, 7, 8 and 9 passwords
- [Cisco: Software Lifecycle Support Statement, IOS XE](https://www.cisco.com/c/en/us/products/collateral/ios-nx-os-software/ios-xe-26/bulletin-c25-2378701.html) - from 26.1.1 every IOS XE release is an Extended Support release with 48 months from GA; no 26.x edition of the two System Management chapters was found at the 17.x paths (HTTP 404), so the 17.x guides are cited, and the 17.18 guide for passwords
- [RFC 7468, Textual Encodings of PKIX, PKCS, and CMS Structures, April 2015](https://www.rfc-editor.org/rfc/rfc7468.txt) - encapsulation boundaries -----BEGIN label----- and -----END label----- and the label grammar (2, 3); PRIVATE KEY (10) and ENCRYPTED PRIVATE KEY (11)
- [OpenSSL 3.5 manual: PEM_read_bio_PrivateKey(3)](https://docs.openssl.org/3.5/man3/PEM_read_bio_PrivateKey/) - the traditional private key format and its PEM ENCRYPTION FORMAT: -----BEGIN RSA PRIVATE KEY----- with Proc-Type: 4,ENCRYPTED and DEK-Info headers (OpenSSL 3.5 is the long-term-support release: "Version 3.5 will be supported until 2030-04-08 (LTS)", openssl-library.org/policies/releasestrat/, read the same day)
- [OpenSSH portable source: sshkey.c](https://raw.githubusercontent.com/openssh/openssh-portable/master/sshkey.c) - MARK_BEGIN -----BEGIN OPENSSH PRIVATE KEY----- and MARK_END
- [RFC 9110, HTTP Semantics, June 2022](https://www.rfc-editor.org/rfc/rfc9110.txt) - field names are case-insensitive (5.1); the auth-scheme is a case-insensitive token (11.1); credentials and token68 (11.2, 11.4); Authorization and Proxy-Authorization (11.6.2, 11.7.2)
- [RFC 6750, OAuth 2.0 Bearer Token Usage, October 2012](https://www.rfc-editor.org/rfc/rfc6750.txt) - Authorization: Bearer <b64token> and its example token (2.1)
- [RFC 7617, The 'Basic' HTTP Authentication Scheme, September 2015](https://www.rfc-editor.org/rfc/rfc7617.txt) - Authorization: Basic <base64 of user-pass> and its examples (2)
- [RFC 6749, The OAuth 2.0 Authorization Framework, October 2012](https://www.rfc-editor.org/rfc/rfc6749.txt) - the access_token and refresh_token members of a token response and its example (5.1)
- [AWS Identity and Access Management User Guide: IAM identifiers, Understanding unique ID prefixes](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - AKIA: access key; ASIA: temporary (AWS STS) access key
- [AWS Identity and Access Management User Guide: Manage access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) - an access key is an access key ID (AKIAIOSFODNN7EXAMPLE) and a secret access key
- [AWS Command Line Interface User Guide: Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) - aws_access_key_id, aws_secret_access_key and aws_session_token as name=value lines, with the documented example values
- [RFC 7519, JSON Web Token (JWT), May 2015](https://www.rfc-editor.org/rfc/rfc7519.txt) - JWTs are JWS or JWE compact serializations (1); the example JWT (3.1), the unsecured JWT (6.1), the encrypted JWT (A.1)
- [RFC 7515, JSON Web Signature (JWS), May 2015](https://www.rfc-editor.org/rfc/rfc7515.txt) - base64url without padding (2); alg is required (4.1.1); compact serialization, three parts (7.1)
- [RFC 7516, JSON Web Encryption (JWE), May 2015](https://www.rfc-editor.org/rfc/rfc7516.txt) - alg is required (4.1.1); compact serialization, five parts (7.1)
- [RFC 3986, Uniform Resource Identifier (URI): Generic Syntax, January 2005](https://www.rfc-editor.org/rfc/rfc3986.txt) - scheme (3.1); userinfo, and "Use of the format user:password in the userinfo field is deprecated" (3.2.1)
- [RFC 5737, IPv4 Address Blocks Reserved for Documentation, January 2010](https://www.rfc-editor.org/rfc/rfc5737.txt) - 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, used in the Example and the vectors
- [Web Content Accessibility Guidelines (WCAG) 2.2, W3C Recommendation 12 December 2024](https://www.w3.org/TR/WCAG22/) - 1.1.1 Non-text Content (a text alternative); 1.4.3 Contrast (Minimum), 4.5:1 for text and images of text; 1.4.5 Images of Text; 1.4.11 Non-text Contrast, 3:1; the definitions of relative luminance (threshold 0.04045) and contrast ratio
- [W3C WAI, Understanding Success Criterion 1.4.5: Images of Text](https://www.w3.org/WAI/WCAG22/Understanding/images-of-text.html) - the intent: use text rather than images of text where the technology can present it
- [W3C WAI, Understanding Success Criterion 1.4.3: Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html) - why 4.5:1, and that images of text are held to it
- [Scalable Vector Graphics (SVG) 2, chapter 11: Text](https://www.w3.org/TR/SVG2/text.html) - addressable characters for positioning are Unicode code points, and x lists one position per character; textLength calibrates and is not applied with forced line breaks; white-space, and xml:space kept for compatibility
- [Extensible Markup Language (XML) 1.0 (Fifth Edition), W3C Recommendation 26 November 2008](https://www.w3.org/TR/xml/) - production [2] Char: the characters an XML document (an SVG) may hold
- [Clipboard API and events, W3C Working Draft](https://www.w3.org/TR/clipboard-apis/) - image/png is a mandatory data type for reading and writing (6.4); the PNG is copied with ClipboardItem where the browser offers it
- [Content Security Policy Level 3, W3C Working Draft 16 September 2026](https://www.w3.org/TR/CSP3/) - img-src governs requests whose destination is image (6.1.6); the navigation directives are form-action and frame-ancestors, so a download link is not an image load
- [SIL Open Font License 1.1, official text](https://openfontlicense.org/open-font-license-official-text/) - JetBrains Mono (copyright 2020 The JetBrains Mono Project Authors, as the LICENSE file of the installed @fontsource/jetbrains-mono 5.2.8 says) is under the OFL 1.1; the font is named in the SVG, not embedded

## Related reading

- [Code on slides and in tickets: images of text, alt text, contrast, and the secrets a screenshot keeps](https://ronutz.com/en/learn/code-on-slides-and-in-tickets.md): A picture of a configuration or a terminal is the quickest way to put it on a slide or in a ticket, and it costs three things: people who need the text as text lose it, people who need contrast may lose that too, and whatever secret was on the screen is now in the picture. Here is what WCAG 2.2 asks of images of text, what good alt text for code looks like, and the documented formats of the secrets that leak through screenshots most often.
- [Colour contrast: the WCAG arithmetic, and the ten ways CSS spells a colour](https://ronutz.com/en/learn/colour-contrast-wcag-and-css-color-notations.md): Whether text can be read against its background is, in WCAG, a single number computed from two colours, and the computation is short enough to do by hand once. Here is the arithmetic (relative luminance, the ratio, the 4.5:1 and 3:1 thresholds and where they come from), followed by the notations CSS Color Level 4 lets you write a colour in, from #hex to oklch(), and why the newer ones make a failing pair easier to fix.
- [Reading a raw HTTP request, and turning it back into something you can run](https://ronutz.com/en/learn/raw-http-requests-and-how-to-replay-them.md): A capture, a proxy log and an RFC example all hand you the same thing: a request line, some headers and maybe a body. Turning that back into a command you can run looks mechanical and has three traps - the URL is not in the message, some headers must not be copied, and the paste is usually a live credential.
