mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-24 22:02:20 +08:00
Documentation for 0931d530ae
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.5"/>
|
||||
<meta name="generator" content="Doxygen 1.9.6"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: ciphers/caesar_cipher.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.5 -->
|
||||
<!-- Generated by Doxygen 1.9.6 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -137,11 +137,11 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<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>
|
||||
<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_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">
|
||||
<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\]
|
||||
</p>
|
||||
<p> while decryption can be described as, </p><p class="formulaDsp">
|
||||
@@ -175,7 +175,7 @@ Algorithm</h3>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Decrypt given text using caesar cipher. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<p>Decrypt given text using caesar cipher. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">text</td><td>text to be decrypted </td></tr>
|
||||
<tr><td class="paramname">shift</td><td>number of shifts to be applied </td></tr>
|
||||
@@ -225,7 +225,7 @@ Algorithm</h3>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Encrypt given text using caesar cipher. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<p>Encrypt given text using caesar cipher. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">text</td><td>text to be encrypted </td></tr>
|
||||
<tr><td class="paramname">shift</td><td>number of shifts to be applied </td></tr>
|
||||
@@ -261,7 +261,7 @@ Algorithm</h3>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Driver Code </p>
|
||||
<p>Driver Code </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><span class="lineno"> 121</span> <span class="comment">// Testing</span></div>
|
||||
<div class="line"><span class="lineno"> 122</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>();</div>
|
||||
@@ -291,7 +291,7 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Function to test above algorithm </p>
|
||||
<p>Function to test above algorithm </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 100</span> {</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> text1 = <span class="stringliteral">"ALANTURING"</span>;</div>
|
||||
@@ -329,7 +329,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../d6/d2c/caesar__cipher_8cpp.html">caesar_cipher.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user