cyberchef_xor_key_length
Recover the key length of repeating-key XOR using index of coincidence, autocorrelation, and Kasiski statistics, then score candidate key bytes against English to decrypt.
Instructions
Recover the key length of a repeating-key XOR by three independent statistics — index of coincidence, autocorrelation and Kasiski — then score every candidate key byte per column against English and decrypt. Reports what each method concluded, so a disagreement is visible rather than averaged away. CyberChef's XOR Brute Force stops at a two-byte key. Measured over 72 cases: the exact length in 60%, and the length or a multiple of it — which still decrypts — in 96%. Least reliable on short inputs and on plaintext with its own strong period.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The ciphertext. At most 1 MB. | |
| candidates | No | How many ranked candidates to report. | |
| input_format | No | How `input` is encoded. Raw treats it as latin1 bytes. | Raw |
| preview_bytes | No | How much decrypted output to return. 0 for none. | |
| max_key_length | No | Longest key length to consider. | |
| assumed_common_byte | No | Assume this is the most common plaintext byte in every column (32 for text) and take each column's most common ciphertext byte to be it. Unset, every candidate key byte is scored against English instead, which needs no assumption. |