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

Can I, knowing the encrypted and decrypted value, find the secret key? [closed]

For example this code: d1R7 this decrypted value is 100. I think this code goes through base64 and then XOR or Aes. Maybe someone knows how to find the secretKey or maybe you need it? Note: This code ...
1
vote
1answer
123 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
0answers
42 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
1answer
78 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
2answers
136 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
0answers
126 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
1answer
518 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
1answer
167 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
1answer
37 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
1answer
47 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
2answers
150 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
0answers
76 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
3answers
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
0answers
70 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
2answers
271 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
1answer
79 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
2answers
3k 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
0answers
48 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
1answer
448 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
0answers
149 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
1answer
1k 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
2answers
152 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
0answers
74 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
0answers
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
2answers
504 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
0answers
54 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
1answer
120 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
7answers
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
1answer
156 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
1answer
92 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: ...
5
votes
2answers
302 views

How hard is it to find plaintexts whose hashes satisfy $h(a)\oplus h(b)=h(c)$?

Given a cryptographic hash function $h$, for example SHA256, how hard is it to find plaintexts $a,b,c$ such that $$h(a)\oplus h(b)=h(c) \text?$$
3
votes
2answers
321 views

Formula for bits of entropy per bit, when combining bits with XOR

Assume that bits $A$ and $B$ each have .5 bits of entropy per bit. The two-bit result of the concatenation $A‖B$ has 1 bit of entropy total, and it retains the entropy density of .5 bits of entropy ...
1
vote
3answers
142 views

Using sha3 as a deterministic source of psuedo-random bytes for xor encryption

The following code generates a deterministic stream of pseudo-random bytes, using SHA3. ...
3
votes
2answers
291 views

Is it safe to XOR-combine hashes by rotating them first?

I have a small number of hashes. I would like to combine them into a single hash. XORing the hashes ignores their order, which is important. Also, it could lead to a result of zero if there were an ...
0
votes
1answer
105 views

Using xor encryption in the following use case

I use an encryption scheme based on a symmetric cipher, with the corresponding symmetric key encrypted with RSA/OAEP using the public RSA key of the recipient. I now want to use ECC crypto in ...
1
vote
0answers
114 views

Generating a XOR Hash function for a given group of numbers to maximise collisions

Given $x$, a vector of $m$ distinct bit vectors of bit length $N$, I want to use an XOR-hash $h$ such that all $x_i$ collide to the same value. I define an XOR hash $h$ which takes bit vector $q$ as ...
3
votes
2answers
679 views

XOR cipher with fixed key and known relation among plaintexts

I have three messages, each known to be XOR-encoded, with the same key used for each message of this XOR cipher. Encoded message 1: $e_1\,=\,00100111010$ Encoded message 2: $e_2\,=\,01001110110$ ...
2
votes
0answers
121 views

Assignment: XOR-cipher [duplicate]

I am currently attending a IT-Security course at the Tel Aviv University and I stuck with the an assignment task. Please DO NOT post the solution if you know it. But I would be very grateful for any ...
0
votes
1answer
72 views

Can i XOR an array of bytes with an equal length key securely

If i have say 64 bytes, can i XOR those bytes with another 64 random bytes, and have two new arrays, where both are needed to reconstruct the first? Intuetively i need some symmetric encryption like ...
0
votes
0answers
40 views

Approach used with XOR cipher in black box scenery

What's the approach used in cryptanalysis to make an decrypter for a simple xor stream cipher in a Black Box scenery with only the output?
1
vote
2answers
225 views

Secret sharing scheme WITHOUT Shamir Secrete Sharing

I am planning to use the following XOR scheme to divide a secret into only 2 shares (I do not want to use Shamir Secret Sharing for different reasons that are beyond the scope of this post). Here's ...
2
votes
2answers
183 views

Weakness in a CBC-like XOR cipher

A simple symmetric encryption algorithm can be written as follows: Input message M and 64 bit key $K$ Divide M into 64 bit size blocks $B_1...B_n$ Get first block $B_1$ and perform bit-wise $\oplus$ ...
0
votes
1answer
142 views

Boolean XOR function a valid way to verify the integrity of a message

Does the Boolean XOR function represent a valid way to verify the integrity of a message ?
1
vote
2answers
87 views

GMW Multiplication AND for 2 parties

I am looking into the GMW protocol's evaluation for multiplication in 2 parties. I have referred to different materials on it but I didn't exactly understand how $a_i b_j + a_j b_i$ is calculated in a ...
0
votes
1answer
123 views

Example of a Two-party GMW Protocol

I have been looking for a concrete example of GMW protocol for two parties. I was trying with the following example for computing $XOR$ of two parties: A's secret bit is $a = 0$, B's secret bit is $b ...
5
votes
1answer
303 views

Using Diffie–Hellman without a key derivation function

In an answer to another question, it was suggested that the shared secret derived from Diffie–Hellman key exchange could then be used directly as a one-time pad to encrypt a message (by XORing the ...
2
votes
1answer
101 views

Meaning of difference Δ delta

I tried to understand some crypto text but I am new to this. Does this: Let $X,X'$ be $\ell$-bit values, and $\Delta X=X\oplus X'$ means that $X$ and $X'$ have $\ell$ bits and $\Delta X=X-X'$ or ...
0
votes
0answers
200 views

What does a repeated byte between two XORed hexadecimal ciphers mean?

I have two different hexadecimal strings (of same length) that I think are encoded plain text strings. Out of curiosity I XORed them and I found a single hex byte repeated for the length of the two ...
2
votes
2answers
184 views

OTP with fixed plaintext

I have just learned about the OTP, how it uses XOR, and how it's secure if the keys are random. But what will happen when the same plaintext is used again with a new key? $c_1 = k_1 ⊕ p$ $c_2 = k_2 ...
1
vote
0answers
236 views

How to reverse this simple xor encryption function? [closed]

this code decrypts encrypted rom code from an arcade game pcb (it is from source code of Mame emulator) for each byte in rom... ...

1
2 3 4 5 6