The extended Vigenère cipher widens the classic polyalphabetic cipher from the 26-letter alphabet to the full set of 95 printable ASCII characters. Because spaces, digits, and punctuation become part of the alphabet, every visible character in your message is enciphered and the keystream advances on each one.
How it works
Each printable character is treated as a number from 0 to 94 by subtracting the ASCII code of space (32). The repeating key is converted the same way, and the two are combined modulo 95:
P = charCode(plain) - 32 (0..94)
K = charCode(keyChar) - 32 (0..94)
encode: C = (P + K) mod 95
decode: P = (C - K + 95) mod 95
output char = String.fromCharCode(result + 32)
The key index only advances for printable characters, so any non-printable character (newline, tab, accented letter) is emitted untouched and does not consume key material.
Example and notes
With the key Gera!, the plaintext Hello, World! enciphers to a string of
printable symbols where even the comma and space have shifted. Decoding the same
ciphertext with the same key returns Hello, World! exactly. Keep your key
secret and reasonably long: a one-character key collapses this into a simple
Caesar-style shift across all 95 characters and is trivial to break.