Emacs (running in a terminal), 26 bytes (possibly 24 bytes)
The program itself (the commas delimit the boundaries between bytes in the on-the-wire format that Emacs uses to accept its input):
W, S, Ctrl-3, $, D, A, Ctrl-T, S, R, W, D, Ctrl-3, $, 5, Ctrl-Q, 5, f, Ctrl-X, r, Ctrl-Space, 1, Ctrl-X, r, g, 1, Ctrl-T
Encoding of this as raw bytes, to prove byte count:
00000000: 5753 1b24 4441 1453 5257 441b 2435 1135 WS.$DA.SRWD.$5.5
00000010: 6618 7200 3118 7267 3114 f.r.1.rg1.
(Note: some of the details may vary based on how Emacs is configured; this answer requires quoted-char-radix to be set to 16, and for Emacs to use the spellcheck dictionary that's default on my British English system. Both of these seem like reasonable configuration settings, but it's possible that your copy of Emacs may be configured differently. A different dictionary would likely still give a 26-byte program, but slightly different misspellings might need to be used so that the corrections we wanted can be accepted by non-bullet-ridden keys.)
Note about scoring
In addition to the keys specified in the question, I originally thought this answer required either Esc or Alt to work. (Esc is on the half of the keyboard that's still intact, so it morally feels like it should be allowed, but it isn't explicitly permitted.) However, user2845840's answer points out that (with the usual encoding of terminal control codes) Esc can alternatively be typed as Ctrl-3, and that is explicitly permitted by the question. (An aside: while testing this, I learned some other interesting ways to type control codes, with Ctrl-2 typing NUL, and Ctrl-4…7 typing character codes 28…31 respectively. Note that the default configuration of many terminals is to interpret a character code 28 coming from user input as a request to crash the currently running program, so be careful testing this.)
Alt is also on the intact half of the keyboard but isn't mentioned in the question. Although Alt and Esc have different encodings in some terminals, they are encoded the same way in other terminals, and (presumably to work around these compatibility issues) Emacs interprets the two keys (and their encodings) as entirely equivalent to each other. If we could use Alt, though, it would save two bytes (because it has a shorter encoding than Esc does).
I'm not sure whether it should have any influence on the editor wars, but Emacs seems to beat vim at least in the case of this question. Emacs is pretty suited to editor golf measured in bytes, because it relies heavily on chords which take up multiple keypresses but only a single byte (thus an Emacs program is often slower to type than the equivalent Vim program, but shorter on disk). Additionally, most of the most important Emacs commands are in the bottom-left corner of the keyboard, to be close to Ctrl, very helpful with a question like this one.
"You can assume you have the interpreter shell / source editor opened before the bullets came in. Sadly you have not written anything in it before the keyboard was hit.", so I'm assuming that we have an empty file open in Emacs and need to type the password into it. (We'd need to save the file afterwards, and probably exit Emacs, but the bytes for that aren't being counted in other people's answers so I'm not counting them here either. It's totally doable using the left hand side of the keyboard, though, Ctrl-X, Ctrl-S, Ctrl-X, Ctrl-C.)
Taking it a command (or block of similar commands) at a time:
- W, S: Enter
WS into the document.
- Ctrl-3, $: Invoke the spellchecker.
WS isn't a real word, but it finds lots of similar two-letter words. (The usual way to invoke the spellchecker is Alt-$; here, we're using Ctrl-3 as a stand-in for Esc, which in turn is a stand-in for Alt.)
- D: Using the spellchecker, correct
PS. (When the spellchecker is invoked using Alt-$, as happened here, it only checks one word, so it deactivates after doing this.)
- A: insert
- Ctrl-T: Swap the previous two characters, giving
- S, R, W, D: Type
- Ctrl-3, $, 5: We invoke the spellchecker again, because we want to correct our misspelled
PASSWORD. Note that we can't have it guess the word we want on our first try, like it would with
PASSWRD, because the key to accept the closest real word is 0 which we can't press. As a result, the slightly more extreme misspelling
PASSRWD is used to push the word we want into position 5, where we can accept it.
- Ctrl-Q, 5, f: Insert the character with character code U+5f, i.e.
_. The document now reads
PASSWORD_ (or will when we start typing the next command; before then, the underscore doesn't appear in case we type another hex digit).
- Ctrl-X, r, Ctrl-Space, 1: Store the current cursor position (relative to the start of the file) in register 1. For some bizarre reason, this is 1-indexed, so (having written 9 characters so far) the cursor is at position
- Ctrl-X, r, g, 1: Copy the content of register 1 into the document. It now reads
- Ctrl-T: Swap the two characters before the cursor. We now have
PASSWORD_01, like the question asks for.
If we're allowed to use Alt, we can probably encode the "invoke spellchecker" command as the single byte
a4 rather than spelling it out as
24; it appears twice, so that leads to two bytes of savings. (Most modern terminals use
24 as the encoding for Alt-$ to avoid clashes with UTF-8, but the
a4 encoding is also encountered from time to time, sometimes available as a configuration option.)
Possible byte savings probably involve golfier misspellings to correct.
PSASWRD would be a byte shorter to type, but unfortunately, the spellchecker doesn't seem capable of gleaning
PASSWORD out of that, so
PASSRWD is the best approach I've found so far. The register-based approach to gaining
10 is also ridiculously unwieldy, but there aren't many ways of creating numbers from nowhere in Emacs, and
0 is a painful character to get hold of otherwise. (At least there were a couple of amazingly useful coincidences: the cursor just happening to end up in position
10, which contains a
0, right when needed; and the fact that Emacs accepts the redundant
g register operation to insert the contents of a register into the document, in addition to the more intuitive