Caesar cipher edit

The Roman ruler Julius Caesar (100 B.C. – 44 B.C.) used a very simple cipher for secret communication. He substituted each letter of the alphabet with a letter three positions further along. Later, any cipher that used this “displacement” concept for the creation of a cipher alphabet, was referred to as a Caesar cipher. Of all the substitution type ciphers, this Caesar cipher is the simplest to solve, since there are only 25 possible combinations. Often this type of cipher is implemented on a wheel device. A disk or wheel has the alphabet printed on it and then a movable smaller disk or wheel with the same alphabet printed on it is mounted forming an inner wheel. The inner wheel then can be rotated so that any letter on one wheel can be aligned with any letter on the other wheel. For example, if the inner wheel is rotated so that the letter M is placed under the letter A on the outer wheel, the Caesar cipher will have a displacement of 12. To encipher the letter P, locate it on the outer wheel and then write down the corresponding letter from the inner wheel, which in this case is B. The same can be accomplished by placing alphabets on two pieces of paper and sliding them back and forth to create a displacement.

ROT13

ROT13 replaces each letter by its partner 13 characters further along the alphabet. For example, HELLO becomes URYYB (or, conversely, URYYB becomes HELLO again). ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher, developed in ancient Rome. Because there are 26 letters (2×13) in the basic Latin alphabet, ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding. The algorithm provides virtually no cryptographic security, and is often cited as a canonical example of weak encryption.[1] ROT13 is used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance. ROT13 has been described as the "Usenet equivalent of a magazine printing the answer to a quiz upside down".[2] ROT13 has inspired a variety of letter and word games on-line, and is frequently mentioned in newsgroupconversations.

Substitution cipher 


In cryptography, a substitution cipher is a method of encrypting by which units of plaintext are replaced with ciphertext, according to a fixed system; the "units" may be single letters (the most common), pairs of letters, triplets of letters, mixtures of the above, and so forth. The receiver deciphers the text by performing the inverse substitution.

Substitution ciphers can be compared with transposition ciphers. In a transposition cipher, the units of the plaintext are rearranged in a different and usually quite complex order, but the units themselves are left unchanged. By contrast, in a substitution cipher, the units of the plaintext are retaied in the same sequence in the ciphertext, but the units themselves are altered.


There are a number of different types of substitution cipher. If the cipher operates on single letters, it is termed a simple substitution cipher; a cipher that operates on larger groups of letters is termed polygraphic. A monoalphabetic cipher uses fixed substitution over the entire message, whereas a polyalphabetic cipher uses a number of substitutions at different positions in the message, where a unit from the plaintext is mapped to one of several possibilities in the ciphertext and vice versa.

Cryptography "Secret code" redirects here. For the Aya Kamiki album, see Secret Code. "Cryptology" redirects here. For the David S. Ware album, see Cryptology (album). Lorenz cipher machine twelve rotors with mechanism German Lorenz cipher machine, used in World War II to encrypt very-high-level general staff messages Cryptography or cryptology (from Greek κρυπτός kryptós, "hidden, secret"; and γράφειν graphein, "to write", or -λογία -logia, "study", respectively[1]) is the practice and study of techniques for secure communication in the presence of third parties called adversaries.[2] More generally, cryptography is about constructing and analyzing protocols that prevent third parties or the public from reading private messages;[3] various aspects in information security such as data confidentiality, data integrity, authentication, and non-repudiation[4] are central to modern cryptography. Modern cryptography exists at the intersection of the disciplines of mathematics, computer science, electrical engineering, communication science, and physics. Applications of cryptography include electronic commerce, chip-based payment cards, digital currencies, computer passwords, and military communications.

Cryptography prior to the modern age was effectively synonymous with encryption, the conversion of information from a readable state to apparent nonsense. The originator of an encrypted message shared the decoding technique needed to recover the original information only with intended recipients, thereby precluding unwanted persons from doing the same. The cryptography literature often uses the name Alice ("A") for the sender, Bob ("B") for the intended recipient, and Eve ("eavesdropper") for the adversary.[5] Since the development of rotor cipher machines in World War I and the advent of computers in World War II, the methods used to carry out cryptology have become increasingly complex and its application more widespread.

Modern cryptography is heavily based on mathematical theory and computer science practice; cryptographic algorithms are designed around computational hardness assumptions, making such algorithms hard to break in practice by any adversary. It is theoretically possible to break such a system, but it is infeasible to do so by any known practical means. These schemes are therefore termed computationally secure; theoretical advances, e.g., improvements in integer factorization algorithms, and faster computing technology require these solutions to be continually adapted. There exist information-theoretically secure schemes that probably cannot be broken even with unlimited computing power—an example is the one-time pad—but these schemes are more difficult to implement than the best theoretically breakable but computationally secure mechanisms.

The growth of cryptographic technology has raised a number of legal issues in the information age. Cryptography's potential for use as a tool for espionage and sedition has led many governments to classify it as a weapon and to limit or even prohibit its use and export.[6] In some jurisdictions where the use of cryptography is legal, laws permit investigators to compel the disclosure of encryption keys for documents relevant to an investigation.[7][8] Cryptography also plays a major role in digital rights management and copyright infringement of digital media.[9]

Description

Applying ROT13 to a piece of text merely requires examining its alphabetic characters and replacing each one by the letter 13 places further along in the alphabet, wrapping back to the beginning if necessary.[3] A becomes N, B becomes O, and so on up to M, which becomes Z, then the sequence continues at the beginning of the alphabet: N becomes A, O becomes B, and so on to Z, which becomes M. Only those letters which occur in the English alphabet are affected; numbers, symbols, whitespace, and all other characters are left unchanged. Because there are 26 letters in the English alphabet and 26 = 2 × 13, the ROT13 function is its own inverse:[3]

{\displaystyle {\mbox{ROT}}_{13}({\mbox{ROT}}_{13}(x))=x} {\mbox{ROT}}_{13}({\mbox{ROT}}_{13}(x))=x for any basic Latin-alphabet text x. In other words, two successive applications of ROT13 restore the original text (in mathematics, this is sometimes called an involution; in cryptography, a reciprocal cipher).

The transformation can be done using a lookup table, such as the following:

Input ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz Output NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm For example, in the following joke, the punchline has been obscured by ROT13:

Why did the chicken cross the road? Gb trg gb gur bgure fvqr! Transforming the entire text via ROT13 form, the answer to the joke is revealed:

Jul qvq gur puvpxra pebff gur ebnq? To get to the other side! A second application of ROT13 would restore the original.

Letter games and net culture abcdefghijklmnopqrstuvwxyz NOPQRSTUVWXYZABCDEFGHIJKLM aha ↔ nun ant ↔ nag balk ↔ onyx bar ↔ one barf ↔ ones be ↔ or bin ↔ ova ebbs ↔ roof envy ↔ rail er ↔ re errs ↔ reef flap ↔ sync fur ↔ she gel ↔ try gnat ↔ tang irk ↔ vex clerk ↔ pyrex purely ↔ cheryl PNG ↔ cat SHA ↔ fun furby ↔ sheol terra ↔ green what ↔ Jung URL ↔ hey purpura ↔ Chechen shone ↔ FUBAR Ares ↔ Nerf abjurer ↔ nowhere ROT13 provides an opportunity for letter games. Some words will, when transformed with ROT13, produce another word. Examples of 7-letter pairs in the English language are abjurer and nowhere, and Chechen and purpura. Other examples of words like these are shown in the table.[12] The pair gnat and tang is an interesting example which are both ROT13 reciprocals and (taken together) a palindrome.

The 1989 International Obfuscated C Code Contest (IOCCC) included an entry by Brian Westley. Westley's computer program can be encoded in ROT13 or reversed and still compiles correctly. Its operation, when executed, is either to perform ROT13 encoding on, or to reverse its input.[13]

The newsgroup alt.folklore.urban coined a word—furrfu—that was the ROT13 encoding of the frequently encoded utterance "sheesh". "Furrfu" evolved in mid-1992 as a response to postings repeating urban myths on alt.folklore.urban, after some posters complained that "Sheesh!" as a response to newcomers was being overused.[14]

Variants ROT5 is a practice similar to ROT13 that applies to numeric digits (0 to 9). ROT13 and ROT5 can be used together in the same message (ROT13.5).

ROT47 is a derivative of ROT13 which, in addition to scrambling the basic letters, also treats numbers and common symbols. Instead of using the sequence A–Z as the alphabet, ROT47 uses a larger set of characters from the common character encoding known as ASCII. Specifically, the 7-bit printable characters, excluding space, from decimal 33 '!' through 126 '~', 94 in total, taken in the order of the numerical values of their ASCII codes, are rotated by 47 positions, without special consideration of case. For example, the character A is mapped to p, while a is mapped to 2. The use of a larger alphabet produces a more thorough obfuscation than that of ROT13; for example, a telephone number such as +1-415-839-6885 is not obvious at first sight from the scrambled result Z`\c`d\gbh\eggd. On the other hand, because ROT47 introduces numbers and symbols into the mix without discrimination, it is more immediately obvious that the text has been enciphered.

Example:

The Quick Brown Fox Jumps Over The Lazy Dog. enciphers to

%96 "F:4< qC@H? u@I yF>AD ~G6C %96 {2KJ s@8] The GNU C library, a set of standard routines available for use in computer programming, contains a function—memfrob()[15]—which has a similar purpose to ROT13, although it is intended for use with arbitrary binary data. The function operates by combining each byte with the binary pattern 00101010 (42) using the exclusive or (XOR) operation. This effects a simple XOR cipher. Like ROT13, XOR (and therefore memfrob()) is self-reciprocal, and provides a similar, virtually absent, level of security.

Implementation The ROT13 and ROT47 are fairly easy to implement using the Unix terminal application tr; to encrypt the string "The Quick Brown Fox Jumps Over The Lazy Dog" in ROT13:

$ # Map upper case A-Z to N-ZA-M and lower case a-z to n-za-m $ echo "The Quick Brown Fox Jumps Over The Lazy Dog" | tr 'A-Za-z' 'N-ZA-Mn-za-m' Gur Dhvpx Oebja Sbk Whzcf Bire Gur Ynml Qbt and the same string for ROT47:

$ echo "The Quick Brown Fox Jumps Over The Lazy Dog" | tr '\!-~' 'P-~\!-O' %96 "F:4< qC@H? u@I yF>AD ~G6C %96 {2KJ s@8 In Emacs, one can ROT13 the buffer or a selection with the following commands:[16]

M-x toggle-rot13-mode M-x rot13-other-window M-x rot13-region and in the Vim text editor, one can ROT13 a selection with the command:[17]

g?

Further reading edit

External links edit

  • Becket, B (1988). Introduction to Cryptology. Blackwell Scientific Publications. ISBN 0-632-01836-4. OCLC 16832704. Excellent coverage of many classical ciphers and cryptography concepts and of the "modern" DES and RSA systems.
  • Cryptography and Mathematics by Bernhard Esslinger, 200 pages, part of the free open-source package CrypTool, PDF download at the Wayback Machine (archived 22 July 2011). CrypTool is the most widespread e-learning program about cryptography and cryptanalysis, open source.
  • In Code: A Mathematical Journey by Sarah Flannery (with David Flannery). Popular account of Sarah's award-winning project on public-key cryptography, co-written with her father.
  • James Gannon, Stealing Secrets, Telling Lies: How Spies and Codebreakers Helped Shape the Twentieth Century, Washington, D.C., Brassey's, 2001, ISBN 1-57488-367-4.
  • Oded Goldreich, Foundations of Cryptography, in two volumes, Cambridge University Press, 2001 and 2004.
  • Introduction to Modern Cryptography by Jonathan Katz and Yehuda Lindell.
  • Alvin's Secret Code by Clifford B. Hicks (children's novel that introduces some basic cryptography and cryptanalysis).
  • Ibrahim A. Al-Kadi, "The Origins of Cryptology: the Arab Contributions," Cryptologia, vol. 16, no. 2 (April 1992), pp. 97–126.
  • Christof Paar, Jan Pelzl, Understanding Cryptography, A Textbook for Students and Practitioners. Springer, 2009. (Slides, online cryptography lectures and other information are available on the companion web site.) Very accessible introduction to practical cryptography for non-mathematicians.
  • Introduction to Modern Cryptography by Phillip Rogaway and Mihir Bellare, a mathematical introduction to theoretical cryptography including reduction-based security proofs. PDF download.
  • Johann-Christoph Woltag, 'Coded Communications (Encryption)' in Rüdiger Wolfrum (ed) Max Planck Encyclopedia of Public International Law (Oxford University Press 2009).
  • "Max Planck Encyclopedia of Public International Law"., giving an overview of international law issues regarding cryptography.
  • Jonathan Arbib & John Dwyer, Discrete Mathematics for Cryptography, 1st Edition ISBN 978-1-907934-01-8.
  • Stallings, William (March 2013). Cryptography and Network Security: Principles and Practice (6th ed.). Prentice Hall. ISBN 978-0133354690.