2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,17 +1,20 @@
|
|||
;Task:
|
||||
Implement a [[wp:Caesar cipher|Caesar cipher]], both encoding and decoding. <br>
|
||||
The key is an integer from 1 to 25.
|
||||
|
||||
This cipher rotates (either towards left or right) the letters of the alphabet (A to Z).
|
||||
|
||||
The encoding replaces each letter with the 1st to 25th next letter in the alphabet (wrapping Z to A). So key 2 encrypts "HI" to "JK", but key 20 encrypts "HI" to "BC".
|
||||
The encoding replaces each letter with the 1st to 25th next letter in the alphabet (wrapping Z to A).
|
||||
<br>So key 2 encrypts "HI" to "JK", but key 20 encrypts "HI" to "BC".
|
||||
|
||||
This simple "monoalphabetic substitution cipher" provides almost no security, because an attacker who has the encoded message can either use frequency analysis to guess the key, or just try all 25 keys.
|
||||
This simple "mono-alphabetic substitution cipher" provides almost no security, because an attacker who has the encoded message can either use frequency analysis to guess the key, or just try all 25 keys.
|
||||
|
||||
Caesar cipher is identical to [[Vigenère cipher]] with a key of length 1. <br>
|
||||
Also, [[Rot-13]] is identical to Caesar cipher with key 13.
|
||||
|
||||
;See also:
|
||||
|
||||
;Related tasks:
|
||||
* [[Rot-13]]
|
||||
* [[Substitution Cipher]]
|
||||
* [[Vigenère Cipher/Cryptanalysis]]
|
||||
<br>
|
||||
<br><br>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue