Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XOR cipher
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Use and security == The XOR operator is extremely common as a component in more complex ciphers. By itself, using a constant repeating key, a simple XOR cipher can trivially be broken using [[frequency analysis]]. If the content of any message can be guessed or otherwise known then the key can be revealed. Its primary merit is that it is simple to implement, and that the XOR operation is computationally inexpensive. A simple repeating XOR (i.e. using the same key for xor operation on the whole data) cipher is therefore sometimes used for hiding information in cases where no particular security is required. The XOR cipher is often used in computer [[malware]] to make reverse engineering more difficult. If the key is random and is at least as long as the message, the XOR cipher is much more secure than when there is key repetition within a message.<ref>{{Harvnb|Churchhouse|2002|p=68}}</ref> When the keystream is generated by a [[pseudo-random number generator]], the result is a [[stream cipher]]. With a key that is [[Hardware random number generator|truly random]], the result is a [[one-time pad]], which is [[Information-theoretic security|unbreakable in theory]]. The XOR operator in any of these ciphers is vulnerable to a [[known-plaintext attack]], since ''plaintext'' <math>\oplus</math> ''ciphertext'' = ''key''. It is also trivial to flip arbitrary bits in the decrypted plaintext by manipulating the ciphertext. This is called [[Malleability (cryptography)|malleability]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)