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

0
votes
1answer
22 views

Is this MAC correct and secure?

Let $m \in \{0, 1\}^{2n} = m_1 || m_2$. Let's also assume that $F_k$ is a PRF and $G$ is a PRG defined as $G: \{0, 1\}^n \rightarrow \{0, 1\}^n$. Now, Let's define the $MAC$ scheme as follows: $$MAC(...
1
vote
1answer
33 views

Decrypting a vigenere cipher with a reused one-time pad

I understand that when a plaintext is encrypted with a key of the same length, it is referred to as a one-time pad. Now when this key is reused to encrypt another plaintext, there is potential for ...
1
vote
1answer
71 views

What are the disadvantages of XOR key derivation?

Assume a 256-bit Key and a 256-bit Salt, with uniformly distributed entropy, both fully independent. Assume ...
3
votes
0answers
46 views

Upgrading key derivation by adding a XOR with a known value

In general keys for password based key derivation are derived from a password hash such as the old PBKDF2 function or Argon2, possibly followed by another derivation function to derive data and ...
1
vote
2answers
58 views

How is n-bit security calculated with nested encryption?

What will the total $n$-bit security be if I encrypt a message with a 128-bit XOR cipher and then take that ciphertext and encrypt it with a 128-bit key. Is the total security level now 256? One ...
1
vote
0answers
56 views

Is this a PRP? How can I create a distinguisher to show it isn't?

Consider the keyed permutation $F_k : \{0,1\}^2 \to \{0,1\}^2$ with two-bit keys defined as $F_k(x) = k\oplus x$. Is this F a PRP? How can I create a distinguisher D and calculate the difference ...
1
vote
2answers
69 views

Is it possible to use crib drag on base64 cipher text?

I am pretty new to the cryptography scene but I wanted to know if it is possible to use crib dragging on cipher text which doesn't contain words? This data would be encrypted using the same key with a ...
2
votes
2answers
90 views

Replacement for XOR in CBC?

In CBC mode, the XOR operation is used to combine the previous encrypted block with the current plaintext, to be used as the block to encrypt. Apart from other known disadvantages inherent to the mode ...
0
votes
1answer
50 views

Does repeated xoring of the (same) key K lower the entropy of K?

If a symmetric encryption key $K$ has been generated by some recommended (NIST for example) RBG then we should have a key with high entropy. But if we xor other bit-strings (e.g. IVs, other keys, etc....
2
votes
1answer
38 views

Common cyphers where the plaintext is the same length as the cyphertext

What are the common cyphers where the cyphertext is always the same length as the plaintext? I can think of XOR cyphers, and letter-substitution cyphers, what others are there?
-3
votes
1answer
60 views

How to decode function that returns number of 1s of the XOR of (target, a number you choose, and a biased random value)?

I received this problem and unsure how to figure it out. Apparently it is possible to decode the value correctly 99% of the time. An example: Suppose the target is 20, and there is a function (let's ...
0
votes
1answer
164 views

How can a XOR encryption be cracked systematically?

It's given that a string, encoded in hex format, is obtained by XOR encryption of a plain text and a key. The key is unknown (not even the length). What are the ...
2
votes
2answers
51 views

Can one trade off the number of iterations for key length with the PBKDF2?

When using the PBKDF2, is one taking on significant risk if one chooses to lower the number of iterations and choose to have very long keys? Can I XOR my message with a a very long key (plain-text ...
2
votes
1answer
51 views

Is using derived keys for HKDF + AES-GCM safe

I have an existing system which takes a cryptographically secure BLOB from user and pass it to lower API which calls HKDF-Expand to get 2 keys: one is effectively discarded in this scenario and second ...
1
vote
0answers
34 views

Is “hash-then-XOR” a good way of incrementally hashing an unordered set? [duplicate]

Is hashing the individual items, and then XOR-ing the results together, a good way of uniquely hashing an arbitrary unordered set of items? I am thinking of using hash-then-XOR since I want some sort ...
7
votes
0answers
73 views

GCM mode of operation with long-term keys

Cross-post: https://cstheory.stackexchange.com/q/41435/873 Regarding GCM, NIST specifies the following: The total number of invocations of the authenticated encryption function shall not exceed $2^...
-3
votes
3answers
229 views

Practical perfect security in bitwise XOR vs integer addition/subtraction cipher

XOR already provides perfect security in theory but it's hard to apply it in practice due to strict requirements. I was thinking about whether simple addition/subtraction in integer format would not ...
1
vote
2answers
165 views

mapping a 256 bit random number to a 3 bit number

I am making a 2 player dice game that runs for n rounds. To create random dice roles im using a concept a understood from randao. each user generates n sha3 hashes recursively of a random seed : e.g. ...
0
votes
0answers
54 views

find keylength in xor-based encryption

I have found interesting answer, written by GeneQ and now want to understand and implement it. I think, that first point of this answer can be rewritten in follwing way: suppose we have n bytes of ...
1
vote
4answers
180 views

If you XOR a random input with a biased input, the output is random - why?

Ive seen in an answer to this question here : https://stackoverflow.com/questions/5889238/why-is-xor-the-default-way-to-combine-hashes/5889288#5889288 that If you XOR a random input with a biased ...
2
votes
1answer
48 views

Password protection in ARJ: 3 characters of password are retrievable

On this site there is information that one can know first 3 characters (bytes) of the password without brute force. I know that ARJ in older versions has very simple encryption, i.e. XOR with ...
4
votes
1answer
112 views

How many primitive cryptography operations are there? [closed]

Every cipher I've encountered seems to be built from slight variations of only three basic operations: the S-box, the P-box, and the XOR. I’m just wondering, are there any others? And if there aren'...
0
votes
0answers
25 views

Does knowing the seed state given the output, lead to potential compromise?

I see in some answers from 2014, some talk about independent sources of entropy mixed canonically with XOR with say one source which is known in advance. Assuming we are operating on bit string ...
0
votes
1answer
89 views

is XOR-hash difference-unpredictable

Let $F$ be a PRF. The $XOR\text{-hash}$ is defined as: ...
2
votes
1answer
99 views

Solve System of Equations including XOR and Modular Addition

A Dummy cipher is shown in figure below. Plaintext is 16 bits ($X_1$ and $X_2$ are 8 bit each). Ciphertext is computed after two rounds using two round keys $K_1$ and $K_2$. Can the round keys $K_1$ ...
4
votes
1answer
141 views

A problem in secret sharing and mixed operators over $\mathbb{Z}$

Recently, I studied an article in which it was written that having $(A-B)\oplus C$ and $B\oplus C$, we cannot find $A$. The authors used this result to build a secret sharing scheme, but they did not ...
1
vote
1answer
95 views

Counting the $\operatorname{XOR}$ of an Element over the Finite Field $\operatorname{GF}(2^q)$

Definition: The $\operatorname{XOR}$ count of an element $\alpha$ in the finite field $\operatorname{GF}(2^q)$ is the number of $\operatorname{XOR}s$ required to implement the multiplication of $\...
3
votes
0answers
178 views

Why is XOR preferred over XNOR in cryptography? [duplicate]

The advantages and properties exhibited by XOR are also exhibited by XNOR, like the ones mentioned in many answers like this one Information is preserved. $c = a \oplus b$. One may recover $a = c \...
0
votes
1answer
1k views

Breaking a XOR cipher of known key length?

For a challenge, I need to find the key that enciphered a text. I know that the key is of length N (invariable). There is no assurance that the key is only alphabetical or alphanumeric, but it could ...
-2
votes
2answers
403 views

Why the AES perform encryption in 10 rounds Instead of one?

I'm a Master's Degree student and researching about AES-128 encryption. My Advisor asked me a question about necessity of iterative rounds in AES. he asked:"why we couldn't encrypt a 128-bit plaintext ...
2
votes
2answers
79 views

Is it possible to find two sets such that their hash xor summation is the same?

Consider two sets $A=\{a_1,a_2,\cdots,a_n\}, B=\{b_1,b_2,\cdots,b_m\}$; $m,n$ can be different. we can calculate the xor summation of each element's hash value: $XOR(A)=(hash(a_1)\oplus hash(a_2) \...
1
vote
4answers
161 views

Cryptography XOR Question

Recently I encountered an interview question related to XOR and I have no idea how to figure it out. The question is as below: The algorithm is: $A\oplus B$ (operation) $C = D$ We have the value of $...
0
votes
2answers
69 views

Shortest key in symmetric algorithm used only once is unsecured?

Considering a message of n bits, one ridiculously short key of 1 bit and using this cryptographic function which performs the <...
0
votes
1answer
100 views

Combining keys after key expansion: is it secure?

I've found an algorithm taht performs the following: expand the two keys using cryptographic hashing functions so the final keys will look like nonsense ASCII, then XOR them together to create a ...
1
vote
1answer
280 views

Security of a sha-256 based stream xor cipher?

Provided that I have some data I want to cipher and a password to do it: I generate a random IV I define c = sha256(password) I generate an infinite stream where <...
2
votes
2answers
970 views

Known plaintext attack without knowing the location of the plaintext

I'm trying to understand known plaintext attacks and since I best learn by doing I broke out Python and did the following: I have a plaintext string s and a key <...
0
votes
1answer
33 views

Reversing ITUbee's diffusion operation

One of the functions used in ITUbee's round function is $L$ which is defined as $L(A, B, C, D, E) = [E \oplus A \oplus B, A \oplus B \oplus C, B \oplus C \oplus D, C \oplus D \oplus E, D \oplus E \...
3
votes
2answers
74 views

Can a CSPRNG, seeded with a key, be used to generate a byte sequence as long as the plaintext to XOR it with that?

Given a “safe” (meaning: brute-force is your only shot) cryptographically strong PRNG, wouldn't it be safe to encrypt data using the CSPRNG to create a key as long as the data and then encrypt the ...
1
vote
1answer
121 views

Practical BCrypt plus XOR encryption for small messages

This is a practical solution available and potentially useful to everyone, so please give some leeway not banning this question. Details are at the end, but here is the question: How secure is the ...
1
vote
1answer
97 views

Using Hadamard Form of a Matrix in the Block Cipher

Definition: A matrix A of size $2^n$ is a Hadamard matrix, if has the following form $$ A= \left( \begin{array}{cc} U & V \\ V & U \end{array} \right)_{2^n\times 2^n}\, , $$ where $U$ and $V$...
1
vote
1answer
109 views

is the perfect secrecy of one time pad dependent on the xor randomness preserving property?

Is the perfect secrecy of the one time pad dependent upon the xor "randomness preserving" property (xoring a uniformly random string with any string yields a uniformly random string)? I have seen ...
3
votes
2answers
264 views

Decrypting two XORed compressed messages?

If through a previous attack, cipher misuse or two time pad etc. I receive $c=m_1 \oplus m_2$. Where $m_1$ and $m_2$ are compressed messages, for instance GZIPped English text documents. Can we ...
0
votes
1answer
166 views

XORing to detect decrypted value?

So I am doing a CTF and I have found a text that is full with hexadecimal encrypted value with XOR (that was a given hint from the previous flag). I don't have the key but I know the length of the key ...
1
vote
1answer
77 views

RNG Source Combining

I'm planning on combining RNGs from several sources (Windows, Linux, OpenBSD, etc.) for generating one time pads but I have some questions that I don't know how to answer regarding xoring the outputs ...
0
votes
1answer
290 views

Name of specific cryptography property of XOR

Given $C$ = M $\oplus$ K1 $\oplus$ K2 $\oplus$ K3 One can decrypt $C$ in any sequence, like: $C$ $\oplus$ K1 = M $\oplus$ K2 $\oplus$ K3 $C$ $\oplus$ K1 $\oplus$ K3 = M $\oplus$ K2 $C$ $\...
1
vote
1answer
254 views

Is a one-time pad secure if the encryption method is not?

(The following situation is hypothetical.) I need to communicate something securely and I have decided to use one-time pads. I am going to be using human genes as the source of the OTP data (this is ...
2
votes
0answers
250 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
108 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
429 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 ...