# Tagged Questions

Cryptographic functions which transform plaintext into ciphertext or the other way around.

9answers
3k views

### Why not the one-time pad with pseudo-number generator

I am very new to cryptography (so be kind), but I have a question that may seem silly. If the one-time pad is the perfect cipher and impossible to crack, why would the following algorithm not be one ...
2answers
5k views

### What is the main difference between a key, an IV and a nonce?

What are the main differences between a nonce, a key and an IV? Without any doubt the key should be kept secret. But what about the nonce and the IV? What's the main difference between them and their ...
4answers
651 views

### Could one construct a cipher that is secure for friendly parties to use but insecure for hostile parties?

Consider the situation of a nation state (Blue) at war with another nation state (Red). Blue wants to deploy a secure cipher that blue currently can not break, but they are considered that Red could ...
1answer
985 views

### How can I make my cipher show the avalanche effect?

I am a beginner in cryptography. I designed an password based encryption-decryption algorithm, which uses a random salt and a password to encrypt a message. I'm using SHA-512 for hashing, matrix ...
2answers
739 views

### Can AES decryption be used as encryption?

Definition E: AES encryption D: AES decryption x: plain text y: encrypted text k: key In original AES cipher, encryption: y = E(x, k) decryption: x = D(y, k) Then I define the "reverse AES ...
5answers
360 views

### Choose a random number that is different from a bunch of other secret numbers

I'm looking for an algorithm where n participants each have a different secret number between $[0..x]$ (and where $x$ is known) and where the participants then select randomly another, non-secret, ...
3answers
2k views

### The exact difference between a permutation and a substitution

I've noticed confusing definitions about permutation and substitution, preventing to make the difference. A permutation changes the order of distincts elements of a set, but this can be writen as a ...
5answers
2k views

### Relative security of a Vigenère cipher

Within a closed computer network, I am ciphering some plaintext data as an added security measure. This is below several other layers of protection. For various technical reasons, I am restricted to ...
2answers
936 views

### What is the security loss from reducing Rijndael to 128 bits block size from 256 bits?

As you know in the past few weeks it has emerged that NIST/NSA have been involved in weakening encryption standards over a long period of time so that they can retain the ability to break encryption ...
3answers
419 views

### AES column mixing and S-Box confusion

I am trying to understand the AES encryption algorithm. I know that we process 128 bits at a time for a 128 bit key in a 4x4 octet form, but am confused by the following: How does the substitution ...
1answer
208 views

### Dancing confusion with Daniel J. Bernstein's stream ciphers

I know of Salsa20 which won the ESTREAM competition. This is dated of 25 Dec 2007. There is also the ChaCha20 stream cipher (cr.yp.to/chacha.html). This claims to increase the amount of diffusion ...
1answer
489 views

### What is the best method to determine the language used in a monoalphabetic substitution cipher?

Working on a cipher (which I assume to be a mono-alphabetic substitution cipher due to the letter frequency) I struggle with the fact that I don't know which language the plain text is written in. ...
3answers
1k views

### A simple block cipher based on the SHA-256 hash function [duplicate]

I've come up with this little routine for doing encryption using the SHA-2 (in this case SHA-256) hash function. As such it is a block cipher with a 256 bit (32 byte) block size and an arbitrary key ...
2answers
2k views

### Difference between symmetric and asymmetric hash function?

The Linux kernel supports symmetric and asymmetric hash functions. E.g. sha1, sha256, ... See tcrypt.c and search for test_hash_speed and ...
1answer
107 views

### Question about the definition of a perfect cipher

I need to prove that the following encryption scheme is a perfect cipher: Let $p$ be a prime. The secret key is a pair $(a,b)$ sampled uniformly at random from $\mathbb{Z}_p^* \times \mathbb{Z}_p$. ...
4answers
556 views

### Do any non-US ciphers exist?

Plenty of ciphers come out of the USA from government research or selection competitions. AES and DES are examples. Are there any public ciphers produced by other states, China or Iran for example? ...
2answers
3k views

### How many keys does the Playfair Cipher have?

I was just studying the Playfair cipher and from what I've understood, it is just a slightly better version of a Caesar cipher, in that it isn't actually mono-alphabetic but rather the 'digrams' are ...
3answers
316 views

### How to perform frequency analysis of a substitution cipher using a Base64 alphabet

Let's imagine a cipher that works like the following: Plaintext is encoded to Base64. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, ...
1answer
299 views

### Security considerations on “expand 32-byte k”-magic number in the Salsa20 famility of stream ciphers?

I'm currently examining the NaCl library written by Daniel J. Bernstein and I noticed that the library hard codes the sigma: ...
2answers
555 views

### Is this hand cipher any more secure than the Vigenère cipher?

I know that inventing one's one crypto always sucks, but the problem is that hand ciphers are usually very insecure very slow. This is an attempt to make a relatively secure, keyable, and ...
1answer
299 views

### When confusion is applied during encryption?

I know confusion is used in cryptography to make it more difficult to identify any relationship between the ciphertext and the symmetric key. I want to know when the confusion is applied during ...
1answer
2k views

### How do I decrypt ciphertext with this cipher?

I have an encryption function $$E(p) = (ap + b) \mod{26}$$ where the parameters are $a=7$, $b = 10$, and $p$ is the plaintext letter. I was asked to decrypt the ciphertext ...
1answer
446 views

### Symmetric encryption mode where ciphertext size is plain text size

I've had many questions on Stackoverflow on how to minimize the output of a cipher - during encryption of course - to the same size as the input. Obviously this is possible for a single block of ...
1answer
199 views

### Decrypting an encrypted text out of order

Does there exist a cipher that can be encrypted twice with two different keys and then decrypted twice using either key first? For example: ...
2answers
153 views

### How to compare two datasets „anonymously”?

Ok, I hope this question makes some sense because I am not so sure how to word it any differently… Imagine the following situation: There are 10 defined colors (blue, orange, yellow etc.) There are ...
2answers
272 views

### Reordering non-block-aligned parts with DES in ECB mode

I was given a ciphertext file which was encrypted using DES in ECB mode. It is known that the plainttext that was encrypted has the following form: Each line of text consists of a payroll followed ...
2answers
1k views

### Is python a secure programming language for cryptography?

I know Python is a powerful programming language but is it secure for cryptography? I mean is it possible to reverse engineer the program (written in python) and discover the algorithm of cryptography ...
2answers
775 views

### Could the Enigma algorithm be classified as a Feistel network?

The Enigma algorithm is a encryption method that was developed (I believe) by the Germans in WWII. It went a little something like this: When a letter was typed on the keyboard of the Enigma ...
4answers
253 views

### Which encryption method supports random reads?

I have a file containing 16-bit samples and I want to encrypt it, but the problem is that I need to be able to read any random 16-bit value from the file, and be to able to decrypt it, without reading ...
1answer
297 views

### SHA256-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 ...
1answer
147 views

### Camellia cipher - is it a symmetric or asymmetric cipher?

I read a wiki page about Camellia cipher and know that it is a block cipher that can use 128-bit, 192-bit or 256-bit keys. But I cant find any information about if its a symmetric cipher (uses one key ...
1answer
81 views

### Do data-dependent rotations have any advantage over fixed rotations?

There are many ARX ciphers, however most use fixed rotations. I know data-dependent compared to fixed rotations are: patented harder to implement constant time more expensive in hardware harder to ...
1answer
242 views

### Diffie-Hellman: Does the size of the prime modulus depend on the potential size of the secret?

I'm writing my own cryptosystem that uses One Time Pad and Diffie-Hellman to generate keys for the OTP. I am using Rails on the server side and Javascript for the client side. Please don't tell me ...
3answers
427 views

### Some cryptography security questions

I recently had a discussion with a friend of mine about cryptography. As we are both no experts, I thought that I could better resolve are dispute here :-). My friend said that when he used public ...
2answers
386 views

### Can I construct a feasible stream cipher out of HMAC and a secure hash algorithm?

I have constructed a stream cipher from a secure hash algorithm and a HMAC. Here is a brief description of the algorithm: Let: (Actually Objective-C styled pseudo code) ...
1answer
34 views

### Why must the sender and receiver be synchronised in synchronous stream ciphers?

I would like to know why the sender and receiver must be synchronized in synchronous stream ciphers as said in Synchronous stream cipher. Why is there no synchronization between the sender and ...
1answer
161 views

2answers
307 views

### plaintext and its encrypted version known [duplicate]

I have a (long) text in two versions, encrypted and plaintext. I think it was encrypted using a substitution cipher method (I'm pretty sure, indeed). I'm not good in this matter, I know little about ...
0answers
106 views

### Cipher built from GPU primitives [closed]

Is it feasible to build a cipher (or hash) out of GPU or DSP primitives (e.g. big matrix multiplication, Fast Fourier Transform, big block SIMD, or hardware H.264/AVC codec)? Preferably those are slow ...
1answer
206 views

### What is the period of a cipher?

For the following explanation of RC4: It is a variable key-size stream cipher with byte-oriented operations. The algorithm is based on the use of a random permutation. Analysis shows that the ...
2answers
109 views

### Correct way to read a given permutation cipher?

In some literature I am reading – where they are explaining the permutation cipher – they have two examples, which encrypt a small block of text. But they seem to contradict each other: First ...
1answer
315 views

### How do I calculate the maximum plain text length allowable for a certain cipher text length?

I am encrypting and storing sensitive values in the database. I have a set max length in the database, but in order to provide useful user feedback, I'd like to know the max input I should allow for a ...
3answers
221 views

### Looking for cipher that uses one ciphertext

I'm new to Cryptography so please free to edit my question for clarity and add the appropriate tag. I'm trying to research if the following is possible. Suppose John has a message that he ...
1answer
175 views

### Combining Random Hashes - avoiding collisions and ensuring randomness

I have a series of integers which I want to convert to random integer (64 bit). The idea here is to produce random numbers very quickly. The issues that good quality random numbers are required with a ...
1answer
48 views

### Words in Index of coincidence using vignere

I am trying to interpret the formula for index of coincidence from here I am not understanding fi , How i can calculate fi in this context ? Is this the appearance of single word like (...
3answers
77 views

### Deciphering text encrypted with a changing cipher

I know there are many ways to crack basic ciphers were each letter is mapped to some other letter, but what ways are there to decode something that was encrypted using a cipher that changed after ...
1answer
36 views

### What does K stand for in frequency analysis

It was from frequency analysis lecture and the professor mentioned but I cannot recall. The K value for English was .067, German was .076. The lowest K was Russian which was .056. When the frequency ...
1answer
212 views

### Frequency analysis of Vigenere Cipher

For Vigenere cipher, I understand Find period first (say we have p = 6) Find highest frequency of letter in each group (from 1 to 6) and assume it is "e" in plaintext What if we have more than ...