A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d3/d4c/xor__cipher_8cpp.html below:

TheAlgorithms/C++: ciphers/xor_cipher.cpp File Reference

Implementation of XOR cipher algorithm.

In cryptography, the simple XOR cipher is a type of additive cipher, an encryption algorithm that operates according to the principles:

where \(\oplus\) symbol denotes the exclusive disjunction (XOR) 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 XOR operator to every character using a given key. To decrypt the output, merely reapplying the XOR function with the key will remove the cipher.

Algorithm

Choose the key for encryption and apply XOR operation to each character of a string. Reapplying XOR operation to each character of encrypted string will give original string back.

Note
This program implements XOR Cipher for string with ASCII characters.

Definition in file xor_cipher.cpp.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4