Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Caesar cipher
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== {{Wikifunctions|Z12812|Latin alphabet Caesar cipher}} The transformation can be represented by aligning two alphabets; the cipher is the plain alphabet rotated left or right by some number of positions. For instance, here is a Caesar cipher using a left rotation of three places, equivalent to a right shift of 23 (the shift parameter is used as the [[key (cryptography)|key]]): {{Aligned table|cols=27|class=wikitable|col1header=on | Plain| A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z | Cipher| X|Y|Z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W }} When encrypting, a person looks up each letter of the message in the "plain" line and writes down the corresponding letter in the "cipher" line. Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD Deciphering is done in reverse, with a right shift of 3. The encryption can also be represented using [[modular arithmetic]] by first transforming the letters into numbers, according to the scheme, A β 0, B β 1, ..., Z β 25.<ref>{{cite journal |last=Luciano |first=Dennis |author2=Gordon Prichett |date=January 1987 |title=Cryptology: From Caesar Ciphers to Public-Key Cryptosystems |journal=The College Mathematics Journal |volume=18 |issue=1 |pages=2β17 |doi=10.2307/2686311 |jstor=2686311 |citeseerx=10.1.1.110.6123 }}</ref> Encryption of a letter ''x'' by a shift ''n'' can be described mathematically as,<ref>{{cite book |title=Cryptology Unlocked |url=https://archive.org/details/Cryptology_Unlocked |last=Wobst |first=Reinhard |year=2001 |publisher=Wiley |isbn=978-0-470-06064-3 |page=19 }}</ref> : <math>E_n(x) = (x + n) \mod {26}.</math> Decryption is performed similarly, : <math>D_n(x) = (x - n) \mod {26}.</math> (Here, "mod" refers to the [[modulo operation]]. The value ''x'' is in the range 0 to 25, but if {{nowrap|''x'' + ''n''}} or {{nowrap|''x'' β ''n''}} are not in this range then 26 should be added or subtracted.) The replacement remains the same throughout the message, so the cipher is classed as a type of ''[[monoalphabetic substitution]]'', as opposed to ''[[polyalphabetic substitution]]''.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)