As of May 31, 2023, we have updated our Code of Conduct.

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
17 views

Bit flipping attack in hash function for message authentication

In this picture we have a use of a hash function for message authentication. M is plaintext message. H is hash function. E is encryption block with K symmetric key. || is concatenation of plaintext M ...
Allexj's user avatar
  • 111
1 vote
0 answers
41 views

What happens if the column mixing in AES is replaced by simple XOR and subtraction? [closed]

This is https://github.com/kokke/tiny-AES-c The column mixing function in the AES algorithm implemented. ...
S-N's user avatar
  • 111
1 vote
1 answer
87 views

Can I use Argon2 to encrypt data?

Normally I use Argon2 to generate an encryption key, and then use AES to encrypt data with that key. Can I just set the hash size to be equal to the data size, set the associated data to a random ...
Alice's user avatar
  • 11
0 votes
1 answer
110 views

If I encrypt two plaintexts with different keys, XOR the ciphertexts and send to an adversary, what can he/she do with what I sent?

Let's suppose I encrypt two blocks of 1MiB with AES-256 in CBC mode, each one using different keys, XOR the resulting ciphertexts and send this XORed block to an adversary. Remembering that the ...
alpominth's user avatar
  • 181
1 vote
1 answer
184 views

Cracking an XOR crypt with a know key length [closed]

I'm trying to crack a crypt with a known key length. I deduced that the operation made was a hex XOR. Here is the crypt: ...
MyselfAndOnlyMe's user avatar
0 votes
1 answer
125 views

How many bits of encryption are enforced in WEP (wired equivalent protocol)

I'm currently taking a computer security module in University and as part of a problem have been asked: My thought for the question is that no it does not provide 64 bits of security strength. This ...
hasin's user avatar
  • 77
0 votes
1 answer
44 views

Use same key k in deterministic counter mode to encrypt two different plaintext

What goes wrong if we use the same key k in deterministic counter mode to encrypt two different plaintext messages m0 /= m1. It is not true that c0 = c1, because we XOR output of m0 with input of m1 ...
Amirhossein's user avatar
2 votes
1 answer
98 views

blake3 keyed hash compression output xor'ed with key secure?

I'm currently trying to write the blake3 algorithm in JS using the official whitepaper or what it's called. If I understand correctly then... after the 7 round keyed permutation (at the end of the ...
slee69's user avatar
  • 25
4 votes
5 answers
2k views

why XOR is recommended/Used in every paper I read for encryption and decryption stream cipher?

Stream ciphers use a deceptively simple mechanism: you combine the plaintext data, bit by bit, with “key” bits, using the exclusive or operation. Why can't I use other opeartions such as NAND, AND, ...
Bhargav - Retarded Skills's user avatar
8 votes
1 answer
153 views

AES vs. SHA2 in key-stream generation

A KDF in Counter Mode (e.g., see NIST SP 800-108r1, Section 4.1, similar to HKDF) produces the output as what AES-CTR would do if one replaces AES with SHA2 (or, to be exact, with HMAC). However, NIST,...
uk-ny's user avatar
  • 129
1 vote
0 answers
22 views

Encrypting an IV with XEX using a block cipher and XORing on the plaintext: Is this scheme valid?

I had an idea to make XEX mode parallelizable at CPU level. Let's suppose I take an IV, XOR with random data, encrypt, XOR again with another data, and XOR on the plaintext Would this encipherment ...
phantomcraft's user avatar
1 vote
1 answer
123 views

Is the xor of a prg and a function still a prg?

I have this couple of deterministic functions $G_1$ and $G_2$. Suppose at least I of them is a PRG. Take $G^*=G_1(x)$ xor $G_2(x)$ with the same $x$. I have to show whether this is still a PRG. I ...
Cristie's user avatar
  • 61
3 votes
1 answer
166 views

Will XORing two bad hashes lead to a collision resistant hash?

I'm reading the fourth edition of "Cryptography: Theory and Practice" by D.R. Stinson and M.B. Paterson. In the book, they have mentioned the concept of "collision-resistant hash" ...
Dniel BV's user avatar
1 vote
1 answer
88 views

Encrypting with CBC then XORing repeatedly a chunk of random data smaller than the plaintext: Is there a gain in security?

If I encrypt a 1MiB file with AES-CBC (or any other cipher) and XOR a 128KiB of (truly) unpredictable random data repeating until the end of file, will I have a security of 1048576-bits (128KiB*8)? ...
phantomcraft's user avatar
1 vote
0 answers
52 views

DES next round key

I don't understand which DES key is used in the next round of Feistel construction. As you can see below, we use our original key that has been inserted in permuted choice 1, where we got 56 bits, ...
joxavy's user avatar
  • 11
2 votes
2 answers
918 views

What are the performance reasons behind "xor-a-rotated-sum" instead of "add-a-rotated-xor" in Salsa20?

I'm currently reading the specification of Salsa20 (link). DJB on whether he chooses "xor-a-rotated-sum" instead of "add-a-rotated-xor" states the following : Should there be ...
JAAAY's user avatar
  • 826
1 vote
1 answer
132 views

Reversing an XOR encryption/decryption function

I have a help recommended high-school project that I'm stuck with. To basically explain the problem: I have an encryption function that is used as the decryption function and I need to reverse it to ...
Roberto's user avatar
  • 13
1 vote
1 answer
152 views

The XOR operation, is it a quantum resistant operation and why is that? if not, what is the most lightweight alternatives?

The XOR operation is an important part of most of the existing end-to-end authentication protocols. Will it be part of the post-quantum authentication protocols?.
Student's user avatar
  • 11
3 votes
2 answers
1k views

How to securely XOR two passphrases in JavaScript?

Is following approach secure? Planning on using implementation to XOR two passphrases before feeding result to Argon2. ...
sunknudsen's user avatar
2 votes
1 answer
97 views

What is the name of this kind of logic diagram?

I want to read this kind of diagram, but I haven't found the name of this, or somewhere I can find a legend of symbols used, or a tutorial to learn reading this... I've googled this for over an hour, ...
Fabien's user avatar
  • 23
1 vote
1 answer
104 views

What is the security of multiple encryption using Even–Mansour scheme (XEX)?

As I know, the best attack on single or double Even-Mansour scheme is N/2, being N the key size (or size of one of the two keys used). I know that encrypting two times using this scheme is susceptible ...
phantomcraft's user avatar
4 votes
2 answers
300 views

Proof that the Family of Toeplitz Matrices is XOR-Universal

Definition of XOR-Universal hash functions by Abidin[1]: A class $H$ of hash functions from $M$ to $T$ is XOR-Universal$_2$ ($XU_2$) if there exist at most $|H|/|T|$ hash functions $h$ $\in$ $H$ such ...
Hernichtocles's user avatar
2 votes
3 answers
227 views

What does $(a+b) \bmod{256}$ and $a$ XOR $b$ reveal about $a, b$?

Say $a$ and $b$ are some uniform random $8$ bits so that the entropy of $a$ and $b$ is 8 bits each. If I show you $(a+b) \bmod{256}$ and $a$ XOR $b$, then what can you tell about $a$ and $b$? Or how ...
caveman's user avatar
  • 553
1 vote
0 answers
46 views

What is the security of XORing SHAKE256_XOF with itself?

After reading "Can the xor of two RNG outputs ever be less secure than one of them?" I wondered if you can increase security of SHAKE256_XOF by using ...
Brandon's user avatar
  • 175
0 votes
1 answer
1k views

How can I decode a XOR cipher with a string key I know?

I have a text that has been XORed with the key "77U" (I am sure of this as it is a file created by a code I have, so I have seen every entry getting XORed by 77U. However, none of the online ...
unno's user avatar
  • 3
0 votes
0 answers
42 views

Is multiple encryption with XORs between each encryption operation susceptible to meet-in-the-middle attacks?

Let's suppose I take a cipher with key size equal to the block size (Threefish). I XOR a random block in the ciphertext, encrypt with a key, XOR another random block, encrypt again with another key ...
phantomcraft's user avatar
0 votes
0 answers
86 views

Hamming distance between product and carry-less product

Motivation. There is a fast approximation to conventional multiplication. It conceptually works like long multiplication except for the fact that the carry is discarded instead of applied to the more ...
Dominic van der Zypen's user avatar
0 votes
1 answer
231 views

Why is this code working

I was doing some introductory challenges at CryptoHack and one of the challenges, more precisely it was Favourite Byte, XOR with a single byte. I did my solution with XORing given string and single ...
Sohail's user avatar
  • 103
2 votes
1 answer
143 views

Does adding more XOR layers in the XEX block cipher mode increase its security or double it?

I read about XEX mode of operation in Wikipedia My question is: There are two keys that are XORed against plaintext, if instead of two XORed keys I add 4 or 6, does it increase the security of block ...
phantomcraft's user avatar
13 votes
5 answers
4k views

What is wrong with XOR encryption with secure PRNG?

Suppose I want to encrypt a message with a password. Couldn't I just XOR the bytes with bytes from a cryptographically secure pseudorandom number generator (CSPRNG) with seed being the password, or a ...
newb's user avatar
  • 141
2 votes
1 answer
976 views

Nexor, an encryption algorithm that promises unlimited key sizes: Is it safe?

My intention is not to make spam here, but I came across this project in Github: https://github.com/andrewhodel/nexor It's an algorithm called Nexor, it promises encryption with unlimited key sizes. ...
phantomcraft's user avatar
4 votes
1 answer
350 views

Is there any result which states that if the output of these two functions is XOR'd, the XOR'd output is pseudorandom

Let $\mathbb{G}$ be a group of prime order $p$ with generator $g$. Suppose that I randomly pick $r_1,z_1 \leftarrow \mathbb{Z}_p$ and $r_2, z_2 \leftarrow \mathbb{Z}_p$ and $c \leftarrow \mathbb{G}$. ...
Link L's user avatar
  • 163
0 votes
0 answers
75 views

What happens when we hash already hashed values, concatenated together?

I read on the page 16 of On the Security of Hash Function Combiners that the classical combiner for collision-resistance simply concatenates the outputs of both hash functions $Comb_{\mathbin\|}(M) = ...
Ramesh Sharma Yadav's user avatar
1 vote
0 answers
440 views

How to show the PRF in 4.8(b) is not secure? [closed]

Let F be a PRF defined over $F:\{0, 1\}^n \times \{0, 1\}^n \to Y$. We say that $F$ is XOR-malleable if $F(k, x \oplus c) = F(k, x) \oplus c$ for all $k, x, c \in \{0, 1\}^n$. We say that $F$ is key ...
LJCOUC's user avatar
  • 11
3 votes
1 answer
84 views

Fastest order-sensitive operations

For any $v$ many $b$-bits vectors $(\mathbf{x}_0, \mathbf{x}_1, \ldots, \mathbf{x}_{v-1}) \in \{\{0, 1\}^b\}^v$, what's the fastest way to combine $\mathbf{x}_0, \mathbf{x}_1, \ldots, \mathbf{x}_{v-1}$...
caveman's user avatar
  • 553
1 vote
2 answers
2k views

Is XORing a Base64-encoded string secure?

Theoretically, is it secure to first encode a string using Base64 and then XOR it with a random key or are there potential weaknesses that could be exploited? Obviously this doesn't make any sense in ...
jnhecate's user avatar
4 votes
1 answer
766 views

Weakness of XORing random bytes with secret key

Side A generates 16 (high quality) random bytes and performs XOR with a 16-byte secret key, then data transfers to side B, where the same secret key is used to recover the original 16 random bytes. Is ...
Vladimir Gamalyan's user avatar
0 votes
1 answer
130 views

Showing the pairwise XORed random variables are independent

If $X_i$'s are $3$ independent random variables defined over $\{0,1\}$ with biases $\epsilon_i$'s for $1\le i \le 3 \;$ and $\epsilon_1 = \epsilon_3 = 0.$ Then $X_1 \oplus X_2$ and $X_2 \oplus X_3$ ...
hiren_garai's user avatar
0 votes
1 answer
73 views

Does XORing a random block into a layer of CBC encrypted message add some bit strenght?

Let's suppose I encrypt a message with a block cipher in CBC mode, keep the key and IV secret and XOR a random block of data in each encrypted CBC block, being the XORed block the same for each CBC ...
phantomcraft's user avatar
1 vote
2 answers
212 views

Is it safe to say that a XOR with an unknown input provides a random output?

I am wondering if you have an input $x_{1}$ and you XOR it with an unknown random second input $x_{2}$, is it safe to say that the resulting $x_{1}\oplus x_{2}$ will be random ? The final idea would ...
Dayu's user avatar
  • 11
0 votes
0 answers
176 views

Simple XOR cipher with pseudo random plain text of arbitrary length

We all know that simple repeated XOR cipher over plaintext is trivially vulnerable to known plaintext attack, even when just a part of plain text is known and even to ciphertext only attack if you ...
Manish Adhikari's user avatar
1 vote
0 answers
116 views

What's the difference between H(m) $\oplus$ H(key) and H(m || key) in MAC construction?

We all know that HMAC has the form of $H(ikey || H(okey || M))$. I'm wondering what if we replace the H(okey || M) into H(okey) $\oplus$ H(M)? In other words, is $$H\Big( ikey \mathbin\| \big( H(okey) ...
Max1z's user avatar
  • 125
2 votes
2 answers
368 views

Is Fibonacci-XOR-rotate one-way-ish?

Fix $n\in\mathbb{N}$ with $n > 2$ and consider the following method. Pick relatively prime seeds $x_1, x_2 \in \{0,1\}^n$ (where $x_1, x_2$ are interpreted as binary numbers. Then proceed with the ...
Dominic van der Zypen's user avatar
2 votes
1 answer
183 views

basic question regarding two-time pad attack

Dan Boneh's Crypto 1 Course includes a lesson on stream ciphers with the following slide: He asks the question: And the answer he gives is $m \oplus p$, which is why this is insecure. But I don't ...
David J.'s user avatar
  • 133
1 vote
2 answers
10k views

How to decrypt two images encrypted using XOR with the same key?

I am trying to solve the following puzzle from CryptoHack involving two images encrypted with the same key: I've hidden two cool images by XOR with the same secret key so you can't see them! lemur....
user93353's user avatar
  • 2,290
0 votes
0 answers
124 views

Recreate RC4 Stream cipher

I'm trying to learn how to go about cracking RC4 ciphers (nothing illegal, its an old, i.e., not active challenge for a job application, so no cheating). I have nine md5 hashes with their own ciphers. ...
Richard's user avatar
1 vote
2 answers
398 views

Help me understand how to do a crypto assignment about AES/CBC

I'm doing the Coursera cryptography I course from Dan Boneh. I am attempting to do week 2's programming assignment, but I think I am having some sort of misunderstanding of either the theory, the ...
iammax's user avatar
  • 113
0 votes
0 answers
123 views

Is this a good implementation of digital signature with timestamp?

Is this a good practice ?. How good or bad is this compared to appending a timestamp to the actual data and hashing it as represented below. ...
knobiDev's user avatar
  • 101
2 votes
2 answers
933 views

What is most secure way for one party to encrypt 4 bytes in less than 40 bytes, which will be publicly available?

I have a project where a user needs to store a U32 encrypted on a blockchain such that they can recover it themselves: the user will always have their key available but may "forget" the U32 ...
pinhead's user avatar
  • 245
0 votes
0 answers
88 views

AES MDS D-XOR and S-XOR count

I am trying to implement the D-XOR and S-XOR count in python but despite reading multiple articles on how to perform the calculation I have failed to understand the process used. I would appreciate it ...
X_Novichok_X's user avatar

1
2 3 4 5 6