mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-31 17:22:27 +08:00
Documentation for f1eddf4d65
This commit is contained in:
@@ -4,7 +4,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.13.2"/>
|
||||
<meta name="generator" content="Doxygen 1.14.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers/xor_cipher.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -19,7 +19,6 @@
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
@@ -60,26 +59,20 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<!-- Generated by Doxygen 1.14.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
$(function() { codefold.init(); });
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
@@ -94,10 +87,9 @@ $(function() {
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('d3/d4c/xor__cipher_8cpp.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
$(function(){initNavTree('d3/d4c/xor__cipher_8cpp.html','../../',''); });
|
||||
</script>
|
||||
<div id="container">
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
@@ -121,9 +113,6 @@ $(function(){initNavTree('d3/d4c/xor__cipher_8cpp.html','../../'); initResizable
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#namespaces">Namespaces</a> |
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle"><div class="title">xor_cipher.cpp File Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
@@ -136,32 +125,26 @@ $(function(){initNavTree('d3/d4c/xor__cipher_8cpp.html','../../'); initResizable
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for xor_cipher.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d85/xor__cipher_8cpp__incl.svg" width="248" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="../../d5/d85/xor__cipher_8cpp__incl.svg" width="248" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
<p><a href="../../d3/d4c/xor__cipher_8cpp_source.html">Go to the source code of this file.</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 id="header-namespaces" class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><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="memitem:ciphers" id="r_ciphers"><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">Algorithms for encryption and decryption. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d47/namespace_x_o_r.html">XOR</a></td></tr>
|
||||
<tr class="memitem:XOR" id="r_XOR"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d47/namespace_x_o_r.html">XOR</a></td></tr>
|
||||
<tr class="memdesc:d7/d47/namespace_x_o_r"><td class="mdescLeft"> </td><td class="mdescRight">Functions for <a href="https://en.wikipedia.org/wiki/XOR_cipher" target="_blank">XOR cipher</a> algorithm. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:aeff72a463ffc580c16cc849cbbdc58ef" id="r_aeff72a463ffc580c16cc849cbbdc58ef"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="#aeff72a463ffc580c16cc849cbbdc58ef">ciphers::XOR::encrypt</a> (const std::string &text, const int &key)</td></tr>
|
||||
<tr class="separator:aeff72a463ffc580c16cc849cbbdc58ef"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6099b7e0f1793f418d2c1befca8355a4" id="r_a6099b7e0f1793f418d2c1befca8355a4"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="#a6099b7e0f1793f418d2c1befca8355a4">ciphers::XOR::decrypt</a> (const std::string &text, const int &key)</td></tr>
|
||||
<tr class="separator:a6099b7e0f1793f418d2c1befca8355a4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae1a3968e7947464bee7714f6d43b7002" id="r_ae1a3968e7947464bee7714f6d43b7002"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae1a3968e7947464bee7714f6d43b7002">test</a> ()</td></tr>
|
||||
<tr class="separator:ae1a3968e7947464bee7714f6d43b7002"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</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>
|
||||
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Implementation of <a href="https://en.wikipedia.org/wiki/XOR_cipher" target="_blank">XOR cipher</a> algorithm. </p>
|
||||
<p>In cryptography, the simple <a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a> cipher is a type of additive cipher, an encryption algorithm that operates according to the principles:</p>
|
||||
<ul>
|
||||
@@ -171,14 +154,14 @@ Functions</h2></td></tr>
|
||||
<li>\( (B {\oplus} A) {\oplus} B = B {\oplus} 0 = B \)</li>
|
||||
</ul>
|
||||
<p>where \(\oplus\) symbol denotes the exclusive disjunction (<a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a>) operation. This operation is sometimes called modulus 2 addition (or subtraction, which is identical). With this logic, a string of text can be encrypted by applying the bitwise <a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a> operator to every character using a given key. To decrypt the output, merely reapplying the <a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a> function with the key will remove the cipher.</p>
|
||||
<h3><a class="anchor" id="autotoc_md3"></a>
|
||||
<h3 class="doxsection"><a class="anchor" id="autotoc_md3"></a>
|
||||
Algorithm</h3>
|
||||
<p>Choose the key for encryption and apply <a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a> operation to each character of a string. Reapplying <a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a> operation to each character of encrypted string will give original string back.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>This program implements <a class="el" href="../../d7/d47/namespace_x_o_r.html" title="Functions for XOR cipher algorithm.">XOR</a> Cipher for string with ASCII characters.</dd></dl>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/imdeep2905" target="_blank">Deep Raval</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../d3/d4c/xor__cipher_8cpp_source.html">xor_cipher.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
</div><a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
|
||||
<a id="a6099b7e0f1793f418d2c1befca8355a4" name="a6099b7e0f1793f418d2c1befca8355a4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a6099b7e0f1793f418d2c1befca8355a4">◆ </a></span>decrypt()</h2>
|
||||
|
||||
@@ -325,11 +308,19 @@ Algorithm</h3>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<div id="page-nav" class="page-nav-panel">
|
||||
<div id="page-nav-resize-handle"></div>
|
||||
<div id="page-nav-tree">
|
||||
<div id="page-nav-contents">
|
||||
</div><!-- page-nav-contents -->
|
||||
</div><!-- page-nav-tree -->
|
||||
</div><!-- page-nav -->
|
||||
</div><!-- container -->
|
||||
<!-- start footer part -->
|
||||
<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="../../d3/d4c/xor__cipher_8cpp.html">xor_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.13.2 </li>
|
||||
<li class="navelem"><a href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a href="../../d3/d4c/xor__cipher_8cpp.html">xor_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.14.0 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user