Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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).

2
votes
0answers
255 views

Help me understand how to actually break an XOR/Vigenère cipher [closed]

My friend's server was recently hacked and I'm trying to decipher the malicious files I found in hopes of understanding the hack better. I can tell that they're using an XOR/Vigenère cipher and I've ...
0
votes
1answer
123 views

Multi-Embedded Xor for Perfect OTP

I am looking for a perfect OTP design, so let's see if this design is good. There are 2 issues when it comes to a good OTP system, the key and the plaintext, we will use XOR as cypher: If the ...
1
vote
0answers
51 views

RIsk mitigation: block cypher vs xor

It sort of looks like to me that there is a kind of risk mitigation in the architecture of block cyphers vs the xor cypher. In XOR, the risk is entirely in the random number generator. The XOR ...
4
votes
1answer
458 views

Reversing decryption function involving XORs and bit rotations?

I am trying to reverse this equation to find the encrypted number given to it. Here is the equation: $$y = x \oplus n \oplus (x \ggg 3) \oplus (x \lll 7) $$ $\oplus$ is the bitwise exclusive or ...
3
votes
2answers
317 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 ...
-1
votes
1answer
96 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 ...
8
votes
2answers
2k 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....
2
votes
2answers
315 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 = ...
1
vote
1answer
338 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 ...
1
vote
1answer
44 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 ...
1
vote
0answers
74 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 ...
8
votes
1answer
2k 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 ...
-3
votes
1answer
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 ...
0
votes
2answers
584 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, ...
0
votes
2answers
171 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 ...
0
votes
0answers
88 views

Do these hash functions improve security?

If I use $hmac(k_1,m)\oplus hmac(k_2,m)$ as compared to $hmac(k_1,m)|| hmac(k_2,m)$ does either improve security? I suppose not because $\oplus$ is just a way to scramble data. Can someone ...
2
votes
0answers
133 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 ...
0
votes
1answer
478 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 ...
7
votes
1answer
417 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 ...
3
votes
2answers
439 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 ...
3
votes
2answers
230 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 ...
3
votes
2answers
449 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})$,...
6
votes
2answers
518 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?
1
vote
3answers
5k 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 ...
3
votes
1answer
318 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 ...
7
votes
2answers
782 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 ...
4
votes
1answer
355 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 ...
0
votes
1answer
608 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 ...
1
vote
0answers
276 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. <...
0
votes
1answer
705 views

One time pad XOR question?

For a one time pad to be truly secure do i need to use XOR, like is a numerical otp as secure as a xorred one? Im new to cryptography so this might not even make sense.
0
votes
0answers
109 views

Does XORing two private ECC keys then revealing the derived key compromise the first two?

Suppose: I own two ECC (sake of argument, ECDH 256-bit prime 1) keypairs. I then XOR the private keys for these together to create a new, derived, private key (which I check is "on the curve"). I ...
0
votes
1answer
825 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 ...
13
votes
4answers
5k 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-...
2
votes
2answers
205 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$...
0
votes
1answer
102 views

XOR and bilinear form property

I know that $XOR$ is equivalent to modular addition in the field $\mathbb{F}_2 = \{0,1\}$ (is it right?), and thus should satisfy the following property of a bilinear form: $$\oplus(u+v,w) = \oplus(u,...
2
votes
1answer
43 views

Decomposing a vector of random bits into constituent XORed vectores

Suppose I have N potential predefined, publicly known (pseudo?) random bit vectors: sequence 1: 1001000101010111001... sequence 2: 0100101011101010100... ... sequence n: 0101101010111010001... ...
2
votes
4answers
830 views

Is this an effective obfuscation technique?

Long ago I created a simple program which obfuscated a file by taking the first byte, then XORing it with the second, taking the (original) 2nd byte and X-ORing with the 3rd, etc, down the line. The ...
1
vote
2answers
721 views

What makes an open source encryption algorithm safe?

Take for example the popular AES algorithm where we have a combination of substitution, shift row, mix column, and add key steps involved in encrypting plain test. All of the mathematical operations ...
2
votes
1answer
2k views

Reversing a known encryption algorithm (4-byte repeating key XOR)

I've been practicing for an upcoming CTF competition, and I've finally reached the cryptography stage. I'm a complete newbie in this field (my knowledge is essentially that bcrypt is awesome and md5 ...
14
votes
2answers
3k views

What's wrong with XOR encryption with hash and an iterated salt

Suppose you'd use the following algorithm to encrypt a message Let $k$ be the key to encrypt with Let $m$ be the message to encrypt Split $m$ into groups of 512 bytes Given a hash function with a ...
1
vote
1answer
133 views

How to add passphrase to an RSA key?

If I want to protect a private RSA key, do I just XOR the password into the key, or do I do something else? Is it secure? Edit: I got a good answer from a comment - Hash the password/passphrase with ...
3
votes
1answer
3k views

Cryptanalysis of XOR cipher with repeated key phrase

My assignment is to cryptanalyze cipher text that we know was encrypted with a stream cipher (bitwise XOR of plain text and key stream), and decrypt to plain text. We know the key stream is a repeated ...
1
vote
1answer
163 views

Does sending the same message with 2 different keys in OTP leak information?

Suppose a common message ($M$) is XOR'ed with two different keys $K_1,K_2$ producing two ciphertexts $C_1,C_2$. Thus, $$M \oplus K_1 = C_1\\ M \oplus K_2 = C_2$$ On observing $C_1$ and $C_2$, an ...
0
votes
1answer
434 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 ...
0
votes
1answer
580 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-], ...
3
votes
1answer
192 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, ...
1
vote
0answers
38 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 ...
3
votes
1answer
1k 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. ...
1
vote
0answers
134 views

Is $E_{k}(x) = F_{k}(x) \oplus F_{k}( \bar x)$ PRF?

$E_{k}(x) = F_{k}(x) \oplus F_{k}( \bar x)$ and F is PRF which maps $\left \{0,1 \right \}^n \times \left \{0,1 \right \}^n $ to $\left \{0,1 \right \}^n$. Let two messages $m_{0} = 0^l $ and $m_{1} ...
6
votes
1answer
1k views

Confusing XOR notation in textbook sample solution

I am preparing for the midterm exam in my Data Security class so I am trying to read and understand the textbook's exercise questions. The sample solution at the end the textbook makes this problem ...