mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 12:52:48 +08:00
Documentation for cf562f2244
This commit is contained in:
@@ -140,7 +140,7 @@ 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_md1"></a>
|
||||
<h3><a class="anchor" id="autotoc_md2"></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>
|
||||
|
||||
Reference in New Issue
Block a user