# All Questions

98 views

### Pailler encryption of small integers to 32-bit integers

I want to encrypt very small integers in the range 0-44 using the Paillier cryptosystem. Is there a way to select p, ...
49 views

I have a question about decryption. Let's say I have a bunch of files that are encrypted. Someone gains access to those files, and finds out that he already has one of them, unencrypted. My question ...
81 views

### Integrity compromised - HASH modified

As we are all aware that HASHing is user to verify integrity in cryptography. I have a query about hashing. Suppose a man in the middle attacker manipulates the data and creates new HASH (by running ...
142 views

### Choosing finite field size in Shamir's Secret Sharing Scheme

The Wikipedia article on Shamir's Secret Sharing says to that to have information theoretical security the splitting algorithm should be evaluated using finite field arithmetic on the field ...
385 views

### Cryptography system by combining a block cipher and a stream cipher

I have to come up with a design for a cryptography system by combining a block cipher and a stream cipher. I can't seem to come up with anything on my own. Can someone point me in the right direction ...
240 views

### ECDSA for encryption

ECDSA keys are much shorter than RSA keys, but typically only used for signing, not encryption. Is there an accepted way of doing this? (https://bitcointalk.org/index.php?topic=196378.0 ...
264 views

### Why are twofish or other algorithms not NIST approved, are they still safe?

NIST has a total of 3 approved block ciphers on their website: AES, TDES and skipjack. I get why those are on there (though personally I find TDES a bit iffy) but from my understanding Twofish and ...
202 views

### AES ECB experiment

Generally speaking, ECB mode shouldn't be used. ECB seems to be more of a basic building block than anything else. Because I thought it would be interesting to experiment with encryption (this method ...
306 views

### What prime lengths are used for RSA?

Let's assume we have an RSA 2048 that was produced by two primes multiplication. What is the digit's difference in those 2 factors? For example one prime is 1024 digits and second one 1024 or, one is ...
116 views

### Why not just encrypt the message and the hash of the message to achieve cryptographic integrity? [duplicate]

I've always seen MACs as a way to provide integrity and authentication. You would just append it to some message in clear. But this is clearly not the case when you're doing Encrypt Then Mac. When ...
62 views

### Check if this cryptosystem is safe

Let $G$ be any group where group operations, as well as finding the inverse of an element, can be performed quickly, but the discrete log problem is difficult. Consider the following cryptosystem: ...
385 views

### Generation of a cyclic group of prime order

I am trying to implement a cyclic group generator in Java, but I am running into some issues. In many cryptosystems, the following phrase is expressed during the key generation stage. Let G be ...
92 views

### Analyzing security flaws of cipher

I know using homebrew encryption can be very dangerous as it is very likely to have many flaws in its design. The following concept is just for learning purpose in case anybody is getting red flags ...
161 views

### Voting system validation

I'm developing an application to run elections. A voting system. I would like to give the ability to the voters to check later if their vote were correct computed/casted. assumptions: each user has ...
207 views

### Availability of a simple limited PRNG algorithm

I am in need of a really simple limited PRNG, that either exists or can easily be created in virtually any language on any platform. It takes only the initial seed, and is only expected to generate a ...
191 views

### DHE key exchange. Is it really secure?

Context I recently came across a video on the net showing the process of key exchange in Diffie Hellmann. Alice and Bob want to communicate. Eve is the (wo)man in the middle. This video is the ...
57 views

### When homomorphic encryption goes wrong?

Consider I have two ciphertext $c_1$ and $c_2$ encrypted using RSA encryption. By definition if I multiply them I'd get $c_1.c_2 \ modN$. My question is what would happen if $c_1.c_2 >N$. Can we ...
330 views

### Implementing a web app where the server cannot decrypt its own data?

I'm a cryptography novice, but I think that the world needs to move towards an "encrypt everything" mentality as much as possible. As a result, I've been thinking a lot about ways to build a web app ...
88 views

### stream cipher computation cost [closed]

With AES-CTR the computation time to encrypt a message of lengh $n$ blocks is $n$ computations of the block cipher. What is the running time to encrypt a message of $n$ bits using a stream cipher, ...
86 views

### What does $\to$ mean in the following definition of a block cipher?

In the following picture $\kappa$ is the key length and $n$ is the block size. I understand that $\{0,1\}^\kappa$ means all possible combination of keys and $\{0,1\}^n$ means all possible combination ...
58 views

### How to make a document truly read only

How is it possibile to cryptographically make a document truly read only? As in read only I imply that the user can obviously view it which can be achieved by coding which pixels have which colors. ...
161 views

103 views

### SHA1 multipart calculation

Is it possible to combine SHA1 digest values to get the SHA1 of the concatenated parts ? I know the "S1" SHA1 of "part 1" and the "S2" SHA1 of the "part 2" and I would like to know the SHA1 of the ...
114 views

### How can I process data within a cloud securely?

I'm new to programming and I'm getting ready to design a proof of concept for an app that I'm thinking of building. Problem is I'm a complete noob to cryptography and need a little nudge to point me ...
277 views

### Is C25519/Ed25519 “twist secure”?

This recent new curve mentions something that's new to me: twist security. http://safecurves.cr.yp.to/bada55.html Are the existing C25519/Ed25519 curves secure against this form of attack?
57 views

### Ensuring that an operation takes a relatively specific amount of time, but easily verify the result

I want an algorithm of some sort that can ensure that an operation takes a fairly specific amount of time, but proof that this operation was done can be completed relatively inexpensively. For ...
221 views

### Question on RSA trapdoor permutation

You plan to use a public-key cryptosystem based on the RSA trapdoor permutation in three different real-life applications, in which the attacker has, respectively, only one of the following resources: ...
74 views

### If $G'(s)=G(s0^{|s|})$ and $G$ is a PRNG, is $G'$ necessarily a PRNG? [closed]

I argue it is because there should be no more correlation between the outputs $G(s0^{|s|})$ than between the outputs $G(s)$. Thus we can say the $G'(s)$ is a PRNG that satisfies $|G'(s)| \geq 4|s|$. ...
853 views

### My SSH server public key is 2048 bits, but my account's private key is 4096. What is my effective security?

My SSH server has a 2048-bit public key. But my private key, for clients to login, is 4096-bit. In this case, do I have the brute force protection of 2048 or 4096 bits? My worry is that someone ...
164 views

### Why does DSS have such formulas?

I've learnt the formulas needed for the DSA (http://en.wikipedia.org/wiki/Digital_Signature_Algorithm). But most importantly, I don't quite understand what represents those formulas and why they are ...
677 views

### Why use CBC-MAC? Why not just apply hash function on the whole message?

Why not just apply hash function on the whole message? Why convert that message into blocks and hash those blocks? To avoid collisions?
126 views

### No Birthday Attack to TCR

I'm reading the paper “Collision-Resistant Hashing? Towards Making UOWHFs Practical” , which compared TCR (Target Collision Resistant) and ACR (Any collision Resistant). It says we wish to stress ...
126 views

Consider a secure modern block cipher like AES/Serpent/Twofish. I hear everyone say that the complexity is $2^{128}$ for a 128 block cipher. But isn't the weak link the actual hashed and salted ...
2k views

I'm conducting an experiment dealing with differences in padding across different aes operations for my Intro to Crypto class, and the question says OpenSSL uses PKCS5 padding, and that I need to ...
818 views

### probability of N hash digits colliding

What is the probability of the first N hash digits colliding? for example i made a script that appends the first 5 digits of the file's sha1 hash to the name of the file. So will the probability of ...
378 views

### Recommended authenticated stream cipher for minimum overhead?

I'm running my TCP/IP protocol secured by encrypting each packet with AES128/CBC, bundling a SHA256 HMAC over that packet. This causes quite a bit of space overhead for small packets, so at first I ...
285 views

### Proving HMAC collision probability bounds?

Could someone point to results or proofs about the probability of $$HMAC(k, m_1) = HMAC (k, m_2)$$ assuming the underlying hash function is SHA-256? Would those probabilities be higher/lower if $m_1$ ...
297 views

### Encrypting and Decrypting a 19-digits long BigInteger

How can I take a maximum 19-digits long BigInteger and encrypt it with the following rules: The result must be based on digits and lower-case English letters ...
3k views

### GPG vs PGP vs OpenSSH and management of them [closed]

What is the main difference of the three? Can I use only one of them for everything (e.g. GPG for SSH authentication) If I encrypt my private key with a pass-phrase, is it strong enough so that if ...
195 views

### Is solving a modular linear equation a hard problem when the coefficient is not an invertible element?

Assume that we have a linear equation like this: $$ax=b \pmod n$$ when $x$ is the unknown, and $a$ is not an invertible element in $n$. is finding $x$ a hard problem? (by solving I mean finding an ...
484 views

### Properties of Ideal Straight P-Boxes

What properties should an ideal straight P-Box exhibit?
121 views

### AES 128bit round level recommendation

we don't want change standard just after every attack, now for AES 128bit blocks i think 16 round is secure, but what is best round amount ? we had attack for 7 round then 10 round and it going so on ...
840 views

### Is the AES encryption scheme CPA secure?

Give a 256 bit key space and 128 message space would AES block cipher as the encryption scheme be CPA secure?
729 views

### detecting ROT13/base64 encryption

Is there anyway to detect that a cipher is encrypted with ROT13 Or Base64 without decrypting it using the algorithm and check that the result means (works)? I mean does an algorithm exists that test ...
286 views

### Should I use md5 for my new application?

MD5 is a very fast hash and its output is short and easy to store. Should I use it for my non-security-sensitive application? I don't think so, but I can't seem to convince anyone else that this is ...
3k views

### Is MAC better than digital signature?

MACs differ from digital signatures in the sense that MAC values are both generated and verified using a shares secret key. Does this in any way put MAC on a disadvantage as compared to digital ...
5k views

### How does one implement the Inverse of AES' MixColumns

I got an answer in the related question about Mixcolumn for encryption, but how about decryption? what will I do? Because it said that I will used this: During decryption the Mix Column the ...
293 views

### Factoring a polynomial over a GF [closed]

I have the following question: What polynomial, when factored over the field $GF (2^8)$ based on the irreducible polynomial that is used in Rijndael, will factor into all the polynomials in the ...