# Questions tagged [xor]

XOR, often written ⊕, is one of the basic operations on bits and bit-sequences. It is a building block of many cryptographic primitives (and some higher-level algorithms, like modes of operations).

233 questions
Filter by
Sorted by
Tagged with
464 views

### XOR Encryption with bcrypt password de-biasing

Objective: To have a very simple to verify, but very secure small message encryption. Idea: Message ⊕ bcrypt( Password). We remove password biases with bcrypt ...
104 views

### Practical solution to store a highly valuable message: what am I missing? [closed]

The answers to my previous question (How safe is XOR with multiple independent but non random keys?) revealed quite a few problems, to a degree that a new approach had to be developed. I took the ...
3k views

### Extracting randomness from highly-biased RNG

I have a source with a very low entropy (like 3 entropy bits per 1024 source bits). But I need to construct a 128 bit seed from the source. Will it be helpful to XOR 350 bits with jump 128 bits, e.g....
491 views

### How safe is XOR with multiple independent but non random keys?

I will approach the question from practical side. All the examples are not real, but for illustration purpose only. I have a message, the secret Bitcoin key, which I want to store safely. MESSAGE = ...
819 views

### What are the vulnerabilities of XOR in the following scenario?

What are the security vulnerabilities of the XOR operator in the following scenario: The Key, The Cyphertext and the Plaintext are the same size in bits. The Key is only used once and it's secret The ...
48 views

### Equivalance Operator - Perfect Secrecy

The equivalance operator is the inverse of the XOR operator, it's symmetric. Would this mean that it would also provide theoretical perfect secrecy just like XOR? XOR ...
97 views

### How many Affine function can be made from $4 \times 4$ and $8 \times 8$ S-boxes?

The nonlinearity of an S-Box is defined as the non-linearity of its vectorial Boolean Function. Let $F$ be the hamming distance between the set of all non-constant linear combinations of component ...
3k views

### XOR a set of random numbers

Basic question about XOR and entropy - given a set $S$ of pseudo-random numbers in the range $[0,b]$, will XORing them produce a new pseudo-random number in $[0,b]$ or will the operation decrease the ...
97 views

### Looking for the inverse of the following equation

I am working on some image encryption algorithm and got stuck. I have plaintext data value of $256$ and perform the following (all values in decimal): $$[256 \oplus 2] mod (256) = 0$$ What will be ...
1k views

### Perfect secrecy with XOR & SHIFT?

I have read that XOR provides perfect secrecy, when the key is perfectly random. However it's technically hard to generate truly random numbers, especially on computers, so that is why people use AES, ...
205 views

### Is it possible to unroll stacked XOR'd strings without brute-force?

Given: An initial string (sBase) that is visible to EVERYONE sBase = "syLgETsPihVXBRuVR4eI" Several other strings that are only visible to ME ...
160 views

### Android app cryptography does it fall under US Export laws? [closed]

Basically, I want to encrypt some strings in my app, strings like access tokens or passwords. I planned on using AES, and mainly saw a good library at https://github.com/tozny/java-aes-crypto. Note ...
736 views

### how to get secret keys in xor?

1) a = b ⊕ s1 2) b = a ⊕ s1 3) b ⊕ s2 = c Is there a way to find s1 and s2 if we know many different values of a and c? 4) a1 = b1 ⊕ s1 5) a1 ⊕ s1 ⊕ s2 = c1 I think it is possible if we analysis ...
650 views

### Why XOR and NOT is free in garbled circuit

I am having trouble understanding the term "free" in V.Kolesnikov et al's paper. 1. Why NOT is free In page 4, section 3.1, they said that NOT gate is free by simply eliminating them and ...
609 views

### Does XOR have diffusion properties?

Does the XOR operator provide diffusion if the right side of plain text is XORed against a round key which is then XORed against the left side to produce that side of cipher text, for example in a ...
334 views

### Encryption based solely on XORing with concatenated hash values

I have recently read a bit about Lamport signatures (especially the approach using hash ladders to save disk space) and I found it very interesting that it entirely depends on a hash function. So I ...
840 views

### Prove that the following private-key encryption scheme is not CPA-secure

Consider the following private-key encryption scheme : The shared key is k $\in$ {0,1}n. To encrypt the message m $\in$ {0,1}n, choose random r $\in$ {0,1}n and output $(r, F_r(k)\oplus \overline{m})$,...
564 views

### MAC security using encryption

If a message $M$ contains $n$ message blocks and I XOR the message blocks and encrypt the result using AES, can i use the resulting cipher-text as MAC? is it a good design or bad one?
11k views

### How to XOR two hexa numbers by hand fast

I have an upcoming exam where I can use a simple Calculator. On some sample questions they ask us to XOR two values (for AES round key) and I know how to write it out by hand but is there any other ...
373 views

### The existence of partial homomorphic additive encryption with bit-wise XOR operation

According to Protocol A that was presented in Section 3.1 paper entitled "Some Efficient Solutions to Yao’s Millionaire Problem" (2013). [1] In that protocol they used an assumption that there is ...
907 views

### Can I use PBKDF2 as a stream cipher?

Unfortunately I have to implement some naive homemade symmetric crypto, since ordinary AES CTR is not implemented in available API on target platform. What I’m going to do is, given encryption ...
411 views

### AES in Counter mode for 64 bit input

I was reading how AES can be used for 64 bit data. Than i came to this answer :Is it possible to implement AES with a 64-bit I/O block size? The answer here is given that by running AES in counter ...
881 views

### Decrypt simple CBC message with known IV using XOR encryption

I've been given a ciphertext message, encrypted using CBC. I know that the block size is 12 bytes and I know the plaintext value of the first block. I also know that the encryption function is a ...
396 views

### Valid to hash bytes using XOR shift? [closed]

Is it valid to XOR shift bytes to produce a hash/checksum? I can't find any evidence that it collides more than say CRC32. This code seems to run about 40x faster than Java's util.zip.CRC32 class. <...
941 views

For a one-time pad to be truly secure, do I need to use XOR? In other words, is a numerical OTP as secure as a XORed one? I'm new to cryptography, so this might not even make sense.
1k views

### Are block ciphers vulnerable to “key reuse” and/or “bit-flipping” attacks?

I know that almost all stream ciphers are vulnerable to “key reuse” and “bit-flipping” attacks. Because AES also uses $XOR$ in its algorithm, is it possible for block ciphers – like AES – to be ...
6k views

### Why is a known-plaintext attack considered a complete break?

I read somewhere that if a cipher has a known-plaintext attack, then it is considered completely broken. Say there is a cipher that someone uses where the algorithm is understood and a known-...
380 views

### In what sense addition modulo $n$ ($n>2$) isn't linear in the field $\mathbb{F}_2$?

I've been reading the Reason why “XOR” is a linear operation, but ordinary “addition” isn’t? question, in which one of the answers states that addition modulo $n$ ($n>2$) is linear in $\mathbb{Z}_n$...
139 views

591 views

### File using same key on XOR cipher. Using CBC [closed]

I have some files that are encrypted using an unknown key and it's using the CBC method to encrypt the files. When I XOR two files together the first two bytes are always the same, but different for ...
706 views

### A simple keyed message authentication code using XOR

Suppose I have a key that is at least 32 characters in length and provides at least 128-bits of entropy. If I picked from the character set of [a-hjkmnp-z2-9-], ...
221 views

### Exploiting XOR one-time-pads with alphabet size that isn't a power of 2

I realized that if the key is chosen randomly from a range that isn't a power of $2$, the one-time-pad leaks information about the plaintext. For example, if the alphabet was the first 20 naturals, ...
42 views

### Which protocols / file formats use CBC with a random IV and without a MAC?

Disclaimer: I am a noob so this may well be a stupid question or one that's been asked before. I didn't see it come up after searching, though, so I'm going to assume it hasn't been asked here. The ...
2k views

### Reverse Encryption Algorithm from Decryption code

I have the code for a decryption algorithm but I'm struggling to figure out how to reverse it into the original encryption code. ...
700 views

### Using a one-time pad with a block cipher

The one-time pad is often described with a simple XOR cipher. This is nice for showing the theoretical strengths of the one-time pad, but not so great in real-world scenarios where key reuse is a ...
148 views

1k views

### Is all of encryption based on xor?

For a long time I've been under the impression that all of encryption uses xor at its basic level. Is this true? What other method could be used to encrypt plaintext with a key? Asymmetrically, as ...
590 views

### Any stream cipher with avalanche effect?

As far as I know, all stream ciphers work by generating a stream of pseudo random bytes, and XOR it with the plain text to get the cipher text. It has the property that one bit change in the cipher ...