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

248 questions
Filter by
Sorted by
Tagged with
2k views

### Is this an effective obfuscation technique?

Long ago I created a simple program which obfuscated a file by taking the first byte, then XORing it with the second, taking the (original) 2nd byte and X-ORing with the 3rd, etc, down the line. The ...
601 views

### algebraic attacks for mixed operations (mod 2 and mod 256) [closed]

If a cipher has mixed operations, e.g $\oplus$ (addition mod $2$), and addition modulo $2^8$. How we we going to express them mathematically? Thanks in advance!
987 views

### XOR cipher with three different ciphertexts and repeated key, key length known. How do I find the plaintexts?

Let us say we have three different plaintexts (all alphabets, A-Z): $x$, $y$ and $z$, each of length $21$. Let the key, $a$, be also of length $21$. Now, what we have is $x \oplus a$, $y \oplus a$ ...
397 views

### Significance of repetition in XOR cipher text

I'm attempting to recover plain-text ($P_1, P_2$) from two uneven cipher-text strings ($C_1, C_2$) that I suspect used the same key ($K$). When I XOR $C_1$ and $C_2$ together to obtain ($P_1 + P_2$),...
3k views

### Attack XOR encryption of binary data compressed by zlib with known key length (very short key)

I am trying to break a packet format. The packet format simply packs several files into one big file. The file contents are plain. But the index data which contain offsets, file sizes and filenames ...
65 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 ...
160 views

85 views

### Decomposing a vector of random bits into constituent XORed vectores

Suppose I have N potential predefined, publicly known (pseudo?) random bit vectors: sequence 1: 1001000101010111001... sequence 2: 0100101011101010100... ... sequence n: 0101101010111010001... ...
3k views

### Reversing a known encryption algorithm (4-byte repeating key XOR)

I've been practicing for an upcoming CTF competition, and I've finally reached the cryptography stage. I'm a complete newbie in this field (my knowledge is essentially that bcrypt is awesome and md5 ...
235 views

### Exploiting XOR one-time-pads with alphabet size that isn't a power of 2

I realized that if the key is chosen randomly from a range that isn't a power of $2$, the one-time-pad leaks information about the plaintext. For example, if the alphabet was the first 20 naturals, ...
1k views

### How secure is using a pad (using xor) on a encrypted data, for the purpose of obfuscating/hiding the underlying encryption?

Edit: I know this isn't really a one time pad (as pointed out), though I don't really know what to call it aside from just a pad, I guess. I have been reading around (mostly various stackexchange ...
101 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$ ...
188 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 ...
258 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$ ...
2k views

### Reverse Encryption Algorithm from Decryption code

I have the code for a decryption algorithm but I'm struggling to figure out how to reverse it into the original encryption code. ...
2k views

### Calculating XOR Key Sizes [duplicate]

I've been playing around with the Matasano crypto challenges (cryptopals.com). I had a couple false-starts on the challenge that has you creating a program to calculate the key size of a XOR encrypted ...
41 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: ...
83 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 ...
282 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 ...
100 views

### How many Affine function can be made from $4 \times 4$ and $8 \times 8$ S-boxes?

The nonlinearity of an S-Box is defined as the non-linearity of its vectorial Boolean Function. Let $F$ be the hamming distance between the set of all non-constant linear combinations of component ...
163 views

### Android app cryptography does it fall under US Export laws? [closed]

Basically, I want to encrypt some strings in my app, strings like access tokens or passwords. I planned on using AES, and mainly saw a good library at https://github.com/tozny/java-aes-crypto. Note ...
113 views

### Infer encoding mechanism from $n$-grams distance?

I have a series of obfuscated strings which across the set of strings have regions of high variance and regions of low variance – implying some encoding mechanism as opposed to an encryption procedure ...
13k views

### How to XOR two hexa numbers by hand fast

I have an upcoming exam where I can use a simple Calculator. On some sample questions they ask us to XOR two values (for AES round key) and I know how to write it out by hand but is there any other ...
584 views

### How strong is XOR encryption of 256 bit plain text with 256 bit key?

I was wondering if we take just 256 bits of plain text and simply XOR every bit with a 256 bit key, how strong can it be ?
2k views

### Secure Hash Function based on AES

How secure would a hash function be which appends an extra block of 16 zeroed out bytes to the end of the message and then AES-encrypts it with a well-known password (say the first 128 bits of pi) ...
614 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 ...
443 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 ...
1k views

### What makes an open source encryption algorithm safe?

Take for example the popular AES algorithm where we have a combination of substitution, shift row, mix column, and add key steps involved in encrypting plain test. All of the mathematical operations ...