# Tagged Questions

Design of cryptographic primitives (algorithms), like block ciphers, stream ciphers, random-number generators, hash functions, MACs, key exchanges, public-key encryption or signature schemes. Also tag with the relevant type of primitive. If you ask about a known existing algorithm, also tag with its ...

1answer
447 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 ...
0answers
174 views

### How represent message in Menezes–Vanstone elliptic curve cryptography

I ask about represent message in Menezes–Vanstone elliptic curve cryptography I now encrypt function as follow $C_1 = (M_1 * K_1) mod\ P$ $C_2=(M2 * k_2) mod\ P$ My question is about how much the ...
1answer
412 views

### rsa public and private keys

I have a question about RSA key generation. This is a simple RSA algorithm: Choose p = 3 and q = 11 Compute n = p * q = 3 * 11 = 33 Compute ?(n) = (p - 1) * (q - 1) = 2 * 10 = 20 Choose e such that ...
1answer
72 views

### MD-compliant hashes don't really accept arbitary length input, do they?

When people talk about hash functions, they usually say that they accept arbitrary-length input, but if you actually look at the padding (eg MD-strengthening padding), you see it's like ...
1answer
225 views

### Questions on rank-attacks in Multivariate Cryptography

While reading this article on rank attacks on STS (a public-key scheme based on Multivariate Quadratic (MQ) equations), I stumbled upon some claims that I've also seen in other presentations on ...
1answer
70 views

### What cipher algorithm is this routine using? [closed]

I transfered a code routine from Java to Python: ...
7answers
3k views

### Where can I begin to study the math behind modern cryptography?

Why do I start the word buffers in MD5 with those values specifically? What in the world motivated the decision to use the numbers 1, 1, 2, 3 for the mix columns stagein AES? And what kind of ...
2answers
191 views

### Encryption algorithm designed to be easy to decrypt by machine but impractical to decrypt by hand

I am looking for - or considering the design of a new - encryption algorithm that does not use variable keys, such that it is easy for a computer to encrypt and decrypt any message regardless of its ...
1answer
71 views

### How to establish if a string contains a message

If you have a string S, then the string can be composed of four things: cleartext 'random' data encrypted data compressed or otherwise non-encrypted, but modified, cleartext If you want to see if ...
1answer
138 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
276 views

### Implementation and Testing of SRP-6a

I have been wracking my brain trying to develop a functioning implementation of SRP-6a in Python to use with a 3rd-party API that claims to use SRP-6a with $N=$ 2048-bit prime and generator of $2$. ...
2answers
282 views

### Need 32-bit mixing function that has perfect avalanche between octets

for my hobby tinkering project, I need a mixing function that takes 32-bit input and has 32-bit output (and will, most likely, run in a 32-bit C environment) and the following property (independent of ...
5answers
1k views

### Crypto-Compression Algorithms?

I was wondering, whether there exist such algorithms/enciphering procedures which both compress and encrypt the input data. That means, for starters, the output will be both smaller in size and ...
0answers
61 views

### How good is middle cube method with jumbled digits?

I had to make my own prng for a stream cipher for an inter school science project (I am mentioning that a lot). So I thought of cubing the seed instead of squaring it (like in the middle square ...
1answer
87 views

### How can a good encryptor be made?

I am making an encryptor software for a stream cipher with my own PRNG as a project for an inter school science competition. How can I make one so that after it generates the pseudo random nos. it can ...
1answer
201 views

### How can a good pseudo-random number generator be made?

I am trying to make a pseudo-random number generator so that I can use it in a synchronous stream cipher for encrypting plain text. I want it to generate numbers which are as random as possible. What ...
1answer
218 views

### Is it feasible to use combination of ABE schemes for encrypting the data?

I have a peculiar requirement for preserving the shared log files. For example I have 1000 records which belong to different organizations as listed below and all the logs are present in a single CSV ...
1answer
99 views

### A one way Function provably reversible at N applications with the same seed?

I'm looking for a function that is generally one way from some secret $F(s, A) \rightarrow Y$, where $A$ is known, $Y$ is produced (also known), and $s$ is kept secret. But whose repeated application ...
2answers
321 views

### Advantages of combined PRNGs

This question is related to this one in intention, and this one in scope. Would I be guarding myself against future attacks on a single PRNG if I combine two (or more) together? I am thinking of ...
1answer
111 views

### Is it possible to 'fake' time for TOTP? (Time-based One-time Password)

TOTP (Time-based One-Time Password) Algorithm is used in Two factor authentication. I understand the algorithm and that current time is used as a variable to generate a token. Wiki page for reference: ...
0answers
119 views

### How to compute the decompositions used in fast FHE bootstrapping?

Leo Ducas and Daniele Micciancio's recent paper "FHE Bootstrapping in less than a second" gave an exciting result that one can compute the `atom operation' of Fully Homomorphic Encryption (i.e. ...
1answer
571 views

### Where did the SHAKEs come from in SHA3?

Where did SHAKE128 and SHAKE256 originate from? I am trying to find them in the original Keccak documentation but can't find them. Is it some special mode of Keccak referenced in the documentation? ...
3answers
722 views

### Is there a string that's hash is equal to itself?

I was wondering if there's any string that has a hash equal to itself, so that – when using any (none specific) hash function – the hash would be equal to that string? so that: ...
1answer
472 views

### What benefits do substitution boxes and permutation boxes offer in DES?

I understand that with more encryption rounds the more complex the ciphertext becomes due to multiple substitutions and permutations. What I don't understand is the purpose of these features. I am ...
3answers
297 views

### Cryptographic data structure: sparse array without membership test

I would like a data structure supporting two operations: $\mathsf{set}(k,v)$ and $\mathsf{get}(k)$, with the following properties: $k$ can be any number between $0$ and something impressively large, ...
1answer
183 views

### RC4 key schedule and algorithm design

I've looked up RC4 algorithm and it's seems easy enough but some parts of it seem random to me. In the key schedule part take for example the following part : ...
4answers
204 views

### Is deniable error-correction possible?

This question came up as I tried to answer an earlier question I asked: cryptographic data structure wanted: sparse array without membership test. I still have not resolved that question to my ...
1answer
180 views

### How hard to break a cipher if it has a different key for each word?

Recently I watched the movie 'The Prestige' again but this time the cipher diary impressed me very well. I like to create my own cipher for my diary because I have some time to kill everyday after ...
2answers
95 views

### How do you create a large PRP from a small one?

How can you efficiently create a pseudorandom permutation with a large domain given a PRP with a small domain? Meaning: given an $n$-bit PRP, how can I create an $n k$-bit PRP? I'm only interested in ...
1answer
134 views

### What is the most secure key expansion routine?

I am looking at G now, but is there a better, (in terms of security and speed), means by which a byte array can be expanded that doesn't involve another cipher, just a simple algorithm? I need to ...
1answer
155 views

### Hill Cipher question

Recently, I was given three ciphers to crack for my cryptography class. At this point, I have guessed that one of them is likely a Hill cipher (probably 3x3, as that is the most complex we have done ...
2answers
4k views

### How can I calculate the SHA-256 “midstate”?

Recently I've been trying to implement some Bitcoin-related code, and I've stumbled upon a weird concept, a SHA-256 "midstate". Some explanation is given here. The general concept is that Bitcoin ...
2answers
229 views

### Would xoring 2 independant AES CTRs to produce p-rand introduce vulnerabilities?

Assuming $$AES_{k_1}(C_1) \oplus AES_{k_2}(C_2)$$ where AES is used in CTR mode, $C$ is a 128 bit incrementing counter, keys and counters for both transforms are random as well as unique, and the ...
1answer
543 views

### How should I treat a new cipher release like Spritz?

I have been looking at both the paper as well as the sourcecode of Spritz — a spongy RC4-like stream cipher and hash function by Ronald L. Rivest and Jacob Schuldt. The paper states We have also ...
4answers
218 views

### Solution with high decryption cost and low encryption cost

I am looking for any cryptographic solution that will meet those requirements : Only known method to get the encrypted string need to be brute force. Decrypting on modern computer not more than ...
1answer
162 views

### Proof of Communication

I desire an algorithm in which Alice sends a block of data $X$ to Bob, with proof that the data was both sent and received. Ideally this would take the form of a public-key signature of the block $X$ ...
2answers
136 views

### Is this a plausible PBKDF?

Background: Hello, I'm working on a hobby project in which I might want to implement a key derivation function within a somewhat resource limited embedded system. For standard crypto functions, I ...
1answer
91 views

### Variants of AES? [closed]

Would variants of AES provide the same level of security as AES, say by just replacing the S-box with another one, MDS matrix of Mixcolumn, etc.?
1answer
241 views

### Where do I truncate the bits in SHA 256 hash algorithm?

I'm implementing SHA-256 in PHP using strings. Where do you truncate in the algorithm? There are a lot of places where there's binary addition happening so the number of bits in $W(i)$ keep ...
2answers
361 views

### Security issues of a MAC-then-Encrypt-then-MAC approach?

Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity. What comes to mind is ...
1answer
224 views

### How many degrees of freedom up my sleeve?

Now that we know how the MD2 S-box was constructed, I find myself wondering how good a nothing up my sleeve number it really is. It is derived from $\pi$, but not in a very obvious way, even in ...
1answer
220 views

### Building a stream-cipher out of a hash function?

I've already read this: Is it feasible to build a stream cipher from a cryptographic hash function? However, my proposed construction differs… Suppose the hash generates N bits. These bits are split ...
2answers
1k views

### How exactly does key whitening manage to increase security?

Wikipedia states that key whitening increases security: In cryptography, key whitening is a technique intended to increase the security of an iterated block cipher. It consists of steps that ...
1answer
113 views

### How to only encrypt a subset of the plaintext

I was wondering if there is a smart way for a user to only encrypt a subset of a plaintext. I'll try to be more specific. Let's suppose the user U wants to use a special cipher such that given a ...
1answer
108 views

### About S-box in AES

I am working on AES. Can we expand $s(a \oplus b)$ in terms of $s(a)$ and $s(b)$ where $a$ and $b$ are two eight bit inputs and $s(a)$ is the S-box value of $a$?
1answer
1k views

### How is the MD2 hash function S-table constructed from Pi?

For fun, I'm learning more about cryptography and hashing. I'm implementing the MD2 hash function following RFC 1319 (http://tools.ietf.org/html/rfc1319). I'll preface by saying I know there are ...
9answers
4k 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
1k views

### Reversing DJB2 Hashes

I have some spare time, and a few hundred DJB2-hashed values sitting around. I thought I'd try to do something "useful" and invert DJB2, such that I could calculate the plaintext of the hashes (which ...
2answers
269 views

### Idea for user/pass hashing to prevent rainbow tables, would it work?

I'm very new to cryptography (and security in general, for that matter), but I had an idea that I'm sure is very flawed, but is worth asking. If a computer user, online account, etc, needs to verify a ...
1answer
152 views

### Which algorithm do you recommend for practical use to generate unique passwords for each website?

So, in my imagination there is this simple algorithm with only one master password, let's say a prime number 'p', which I have to remember. Using only the address of the website and p, the algorithm ...