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
1 answer
108 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?.
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. ...
1 vote
1 answer
61 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 ...
2 votes
1 answer
89 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, ...
3 votes
1 answer
145 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 ...
1 vote
1 answer
196 views

Potential weaknesses when combining hash functions?

For consistency's sake, M is the message, H1 and H2 are separate hash functions. I've heard that concatenation or XORing hash outputs together do not provide improved security against preimage and ...
0 votes
0 answers
103 views

Storing secrets on a peer-to-peer network by splitting up AONT data

I've come up with a way to transform a stream of bytes such that if any single bit is modified, it cannot be transformed back into its original state. Here's how it works: Encoding Get hash ...
2 votes
3 answers
210 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 ...
0 votes
1 answer
121 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 ...
0 votes
0 answers
34 views

Does random IVs in CTR block cipher mode combined with XOR allow to encrypt number of blocks up to the same numeric count of IV?

I read about CTR block cipher mode in Wikipedia: "If the IV/nonce is random, then they can be combined with the counter using any invertible operation (concatenation, addition, or XOR) to produce ...
1 vote
0 answers
38 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 ...
4 votes
3 answers
657 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 ...
0 votes
1 answer
229 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 ...
0 votes
0 answers
31 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 ...
0 votes
0 answers
68 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 ...
2 votes
1 answer
91 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 ...
13 votes
5 answers
3k 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 ...
2 votes
1 answer
961 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. ...
15 votes
3 answers
6k 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 ...
4 votes
1 answer
335 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}$. ...
0 votes
0 answers
45 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) = ...
1 vote
0 answers
207 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 ...
0 votes
0 answers
50 views

Is it possible to crack cryptographic method with known input/output?

I've played around with John The Ripper before and it was able to successfully crack some personal passwords via brute force. However, in those scenarios the "unknown variable" was a ...
3 votes
1 answer
79 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}$...
1 vote
2 answers
838 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 ...
5 votes
0 answers
133 views

Upgrading key derivation by adding an 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 ...
4 votes
1 answer
636 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 ...
2 votes
1 answer
196 views

Why is the second XOR operation in OCB mode necessary?

In Rogaway's OCB mode, the offset (derived from the key) ist XOR-added twice: Once to the plaintext block, and a second time after the Encryption. I am wondering, why the second XOR operation is ...
0 votes
1 answer
48 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$ ...
0 votes
1 answer
52 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 ...
1 vote
2 answers
181 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 ...
0 votes
0 answers
125 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 ...
3 votes
3 answers
1k views

Is simple XOR with secret key using DHE secure?

Client and server have given generator 3 and modulus which is 256 bit prime same all the time for all clients and server (simply hardcoded). They both generate a private exponent and send result to ...
1 vote
0 answers
100 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) ...
2 votes
2 answers
323 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 ...
2 votes
1 answer
120 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 ...
0 votes
2 answers
6k 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....
0 votes
0 answers
84 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. ...
4 votes
1 answer
454 views

Salsa20 Implementation: Sum of 2 Words with Carries Suppressed

I'm working on the 2nd part of the Salsa20 spec, and I want to implement a closure for the exclusive-or of two words(u32). The author defines the operation as the sum of two words with carries ...
1 vote
0 answers
173 views

Hamming distance in XOR decryption

I've been working on cryptopals 1.6, breaking XOR, and have got it working. I found this answer that explains why hamming distance works, and after some consideration I believe I'm starting to ...
4 votes
1 answer
2k views

SHA-256-based stream cipher

Can anyone comment if the stream cipher described here is safe? The author claims it to be unbreakable, but does not provide any evidence or proof to support this. For completeness, I have reproduced ...
1 vote
2 answers
254 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 ...
0 votes
0 answers
90 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. ...
1 vote
0 answers
52 views

OTP Random Pad Renewal Without Extending Message [duplicate]

So I recently learned about the concept of a One Time Pad; and I from what I understand it means that if a XOR key is completely random and equal to or longer than the plaintext, it makes it so that ...
1 vote
2 answers
715 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 ...
0 votes
0 answers
65 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 ...
0 votes
1 answer
264 views

Splitting Secret Key

If I split a key $k$ into three pieces as $k1, k2$ and $k3$ how should I distribute the keys among three people such that any two of them are able to evaluate PRF, but be secure from any one of them ...
13 votes
7 answers
6k views

Can I encrypt a message by swapping bits in the text?

I have tried out an encryption method, in which I swap bits in the text. The text length is N bit, then I generate several random number pairs in the range 0..N-1, as [n,k] pairs. After that, I swap ...
1 vote
1 answer
168 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$...
2 votes
1 answer
128 views

Need help finding keysize for Vigenere cipher

I am doing a crypto challenge for breaking a Vigenere style repeating XOR encryption (https://cryptopals.com/sets/1/challenges/6). I have looked at similar questions asked here, mainly this one: ...

1
2 3 4 5 6