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
0 votes
0 answers
27 views

Can I recover the seed used to generate the internal state of MT19937 using the state itself?

Is there any way to extract the seed that has been used to generate the state in python or any other language? I tried to find the implementation of the random.seed ...
Someone's user avatar
0 votes
0 answers
42 views

Decrypting Message Using One-Time Pad with Repeated Key [duplicate]

I'm trying to decrypt a message that has been encrypted using a one-time pad with a repeated key. The encryption technique involves using the same key twice. We know the message was encrypted with $k =...
crypTOl23's user avatar
4 votes
0 answers
146 views

Is the XOR-combiner of independent keyed hash-functions collision resistant?

Assume there are two keyed hash-functions $H_1(k_1, m)$ and $H_2(k_2, m)$, with $k_1$ and $k_2$ being independently randomly sampled public keys. The XOR-combiner is defined as $C_\oplus^{H_1, H_2}:=...
Kristian Koenig's user avatar
1 vote
0 answers
59 views

Identified Performance Discrepancy in my AES addRoundKey: Slower than Expected

Problem I'm working on an AES implementation in C++, and I have been testing the performance of my code, and its functions. I've noticed a significant performance slowdown in my 'addRoundKey' function....
Lachlan's user avatar
  • 101
0 votes
1 answer
169 views

Advantages of AES vs XOR on a plain text file

Currently, I am using AES-GCM to encode and decode a plain text file. The key is derived from a plain text password using PBKDF2 and a random salt with SHA-256. However, I have been thinking and came ...
Hubert's user avatar
  • 1
0 votes
0 answers
35 views

Solving XOR modular system of equations

I have the following problem. Here's a rephrased version of your problem, keeping the LaTeX commands unchanged: We are given $n \in \mathbb{N}$, $p, q \in \mathbb{N}$, and $y \in \mathbb{N}^{n+2}$. ...
Kroki's user avatar
  • 111
1 vote
1 answer
137 views

Solving equation of xor and mod operation

How do I solve equations like this $$(aX \oplus X+b) \bmod M = c$$ If a,b and c are known? and if i have system of of equation with different b values, is it solvable? I am particularly interested in ...
Sora's user avatar
  • 11
1 vote
1 answer
161 views

What is the inverse of this generalised automaton (based on bitwise XOR and modular addition)?

Section 4.1 of the paper “Nonlinear Diffusion Layers” [Y. Liu, V. Rijmen, G. Leander] defines the nonlinear function $\rho$ over $\mathbb{F}_{2^m}$ as follows: $$\rho : \mathbb{F}_{2^m}^4 \to \mathbb{...
lyrically wicked's user avatar
0 votes
0 answers
53 views

2 XORed AES-ECB ciphertexts, zero key and piece of plaintext

I have $C_1 \oplus C_2$ where $C_1$ = $AES128_k(P_1)$ and $C_2$ = $AES128_k(P_2)$. I know the k, it is 0 (i.e. 16 bytes of zeros). I know the piece of $P_1$ (7 ...
stefan09's user avatar
1 vote
1 answer
84 views

Biasedness of the XOR variable of two independent biased boolean variable

My question is very basic one. Suppose there are two independent boolean variable $X_1$ and $X_2$. It is given that $X_1$ is biased towards $0$ and $X_2$ is biased towards $1$ with same amount of bias....
hiren_garai's user avatar
0 votes
0 answers
57 views

Implementation of Ring Signature

I have implemented a ring signature in a Python program, To keep it simple, I have Alice and Bob. Based on this ring equation: $$ v = E_k(y_s⊕E_k(y_i⊕v))$$ I will get: $$ y_s = E_k^{-1}(v)⊕E_k(y_i⊕v) \...
bjpo027's user avatar
  • 11
2 votes
3 answers
169 views

Long Random Key and XOR - How Secure?

I have an application that encrypts files in the following manner (I think I can hear sighs already but bear with me): Start with two byte arrays generated from random strings of lengths l1 and l2 (...
mrrrk's user avatar
  • 23
1 vote
1 answer
46 views

Security of keys that are as long as the data

If both communicating sides end up with the same secret 3000-bit key, is it enough to XOR each byte of the messages with each byte of the secret key to make it secure? Wikipedia says it is, but I ...
Kevin Stefanov's user avatar
2 votes
1 answer
127 views

A problem related to two bitwise sums of rotations of two different bitstrings

Let $r(b, t)$ denote the bitstring $b$ rotated to the left by $t$ bits: for example, $r(00110101, 5) = 10100110.$ Consider the following game. Player A picks two (different) $n$-bit strings $(T_1, T_2)...
lyrically wicked's user avatar
4 votes
2 answers
143 views

XOR for more TRNG data?

If I have TRNG data as input (A1,A2,B1,B2,C1,C2) - can I xor it to provide more TRNG data A,B,C,D,E,F,G,H ? ...
KL391's user avatar
  • 41
2 votes
1 answer
106 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
  • 143
1 vote
0 answers
53 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
  • 127
1 vote
1 answer
361 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
173 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
  • 393
1 vote
1 answer
546 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
204 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
69 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
153 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
6 votes
6 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
206 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
  • 128
1 vote
0 answers
28 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
185 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
  • 93
3 votes
1 answer
194 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
102 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
64 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
1k 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 ...
tur11ng's user avatar
  • 962
1 vote
1 answer
271 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
192 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
2k 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
133 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
2 votes
1 answer
165 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
501 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
241 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
  • 573
1 vote
0 answers
48 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
2k 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
49 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
133 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
370 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
160 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
978 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
356 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
179 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
529 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
93 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
  • 573

1
2 3 4 5
7