How to break the Caesar cipher by brute force

Kapitoly: Caesar's cipher, How to break the Caesar cipher by brute force, How to break the Caesar cipher using letter distances

Brute force attack

Breaking Caesar's cipher is easy because it has a very limited number of keys, only 26. Of these, one key is the letter "a", which does not actually encrypt the open text in any way, leaving 25 keys with which we can encrypt the open text. We just need to try to decrypt the cipher using all 25 keys and see which text makes the only sense.

Example: let's have the ciphertext "ufsipuvetvcpuve". Let's try to decrypt it with all possible keys:

a: ufsipuvetvcpuven: hsfvchirgipchir
b: terhotudsubotudo: greubghqfhobghq
c: sdqgnstcrtanstcp: fqdtafgpegnafgp
d: rcpfmrsbqszmrsbq: epcszefodfmzefo
e: qboelqraprylqrar: dobrydencelyden
f: pandkpqzoqxkpqzs: cnaqxcdmbdkxcdm
g: ozmcjopynpwjopyt: bmzpwbclacjwbcl
h: nylbinoxmovinoxu: alyovabkzbivabk
i: mxkahmnwlnuhmnwv: zkxnuzajyahuzaj
j: lwjzglmvkmtglmvw: yjwmtyzixzgtyzi
k: kviyfklujlsfklux: xivlsxyhwyfsxyh
l: juhxejktikrejkty: whukrwxgvxerwxg
m: itgwdijshjqdijsz: vgtjqvwfuwdqvwf

If we take a cursory look, we see that the only text that makes sense is for the letter "r". So the original open text was probably "hello, all day" and was encrypted with the key "r".

In the following tool, you can try breaking the cipher automatically. Copy some Caesar-encrypted text into the text box and the tool will try to break the text by brute force. If the attack succeeds, the tool prints the key used and the decrypted text. The longer the ciphertext, the higher the probability of successful cracking. One paragraph of text should be sufficient.

Ciphertext: