mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-23 05:12:40 +08:00
Documentation for 692135b480
This commit is contained in:
@@ -112,7 +112,7 @@ Include dependency graph for caesar_cipher.cpp:</div>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:d6/d4e/namespaceciphers"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/d4e/namespaceciphers.html">ciphers</a></td></tr>
|
||||
<tr class="memdesc:d6/d4e/namespaceciphers"><td class="mdescLeft"> </td><td class="mdescRight"><a href="https://en.wikipedia.org/wiki/Base64" target="_blank">Base64 Encoding and Decoding</a> <br /></td></tr>
|
||||
<tr class="memdesc:d6/d4e/namespaceciphers"><td class="mdescLeft"> </td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:dd/d81/namespacecaesar"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d81/namespacecaesar.html">caesar</a></td></tr>
|
||||
<tr class="memdesc:dd/d81/namespacecaesar"><td class="mdescLeft"> </td><td class="mdescRight">Functions for <a href="https://en.wikipedia.org/wiki/Caesar_cipher" target="_blank">Caesar cipher</a> algorithm. <br /></td></tr>
|
||||
@@ -132,7 +132,7 @@ Functions</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >Implementation of <a href="https://en.wikipedia.org/wiki/Caesar_cipher" target="_blank">Caesar cipher</a> algorithm. </p>
|
||||
<p >In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.</p>
|
||||
<h3><a class="anchor" id="autotoc_md0"></a>
|
||||
<h3><a class="anchor" id="autotoc_md1"></a>
|
||||
Algorithm</h3>
|
||||
<p >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. Encryption of a letter x by a shift n can be described mathematically as, </p><p class="formulaDsp">
|
||||
\[ E(x) = (x + n)\;\mbox{mod}\; 26\]
|
||||
|
||||
Reference in New Issue
Block a user