# All Questions

217 views

### Where can i find relative software for differential cryptanalysis?

Is there any publicly known software for differential cryptanalysis over some cryptographic building blocks as blocks ciphers or cryptographic hash functions
6k views

### Difference between encrypting something and hashing something

What is the difference between encrypting something and hashing something? in what situations would I want one or the other?
2k views

### RSA Proof of Correctness

Can anyone provide an extended (and well explained) proof of correctness of the RSA Algorithm? And why is it needed? I can't say that this or this helped me much, I'd like a more detailed and newbie ...
676 views

### Why would anyone use an elliptic curve with a cofactor > 1?

In cryptography, an elliptic curve is a group based on a finite field $GF(p^k)$; this group has $n$ elements on it, and we work on a prime-sized subgroup of size $q$. We denote the value $h = n/q$ as ...
131 views

### Separate Read and Write Keys in TLS Key Material

Why does the TLS protocol use different symmetric keys for receiving and sending data? Isn't it enough to have a single key used for both reading and writing?
79 views

### Incorporating known ciphertext into new message

Which ciphers $c_k$ enable one to define a joining function $f_{c,k}$ such that: $$f_{c,k}(c_k(p_1), p_2) = c_k(p_1 + p_2)$$ That is, the result of joining some known ciphertext $c_k(p_1)$ with a ...
208 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 ...
8k views

### What's the fundamental difference between Diffie-Hellman and RSA?

What is the difference in the purpose of DH and RSA? Aren't they both public-key encryption?
397 views

### How to represent a 32-byte SHA2 hash in the shortest possible string?

I'm calculating a SHA2 hash of a certain sensitive key value. I need to store files on disk using this hash a directory path prefix. So lets say I hash the key value 150023, I get a 32-byte value ...
996 views

### Why does CBC decryption with a wrong IV still give readable results?

While developing some code that uses the .NET AesManaged algorithm, I made some mistakes but was surprised at the results. My encryption was correct. I was generating a random IV block and writing ...
541 views

### What algorithm would give the shortest ciphertext for very short plaintexts?

I have to encrypt some very short messages (approx. 5 characters) and I would like the ciphertext to be as short as possible. I am currently using AES but the initialization vector (IV) is making my ...
240 views

### Does ShaCrypt have the properties which make BCrypt slow on GPUs?

Sha256Crypt / Sha512Crypt are designed based on ideas of BCrypt but use SHA instead of Blowfish because of political requirements. The Sha*Crypt algorithms have the advantage that they are used in ...
168 views

### MD5 implementation doubt

In MD5, there are four rounds. After every round, why do we need to add the computed Q values to the initial values and then take this value as input to the next round. For example after the first ...
478 views

### Encryption vs. decryption of same plaintext

Does the same encryption algorithm given the same plaintext always produces the same ciphertext? Does this cause any security flaws?
998 views

### Hash function in PBKDF2

From this excellent answer I learned (correct me if I am wrong) that when writing a block cipher with say key size 128 bit, one has to pad the password given (variable size) so that it becomes exactly ...
7k views

### What is the difference between known-plaintext attack and chosen-plaintext attack?

I am very confused between the concept of known-plaintext attack and chosen-plaintext attack. It seems to me that these two are the same thing, but it definitely is not. Can anyone explain to me how ...
193 views

### Transparent cipher

I'm trying to implement this protocol: Alice has her permanent key $K_1$. She computes $E(K_1, P)$. She wants to share $P$ with Bob, Carol and Dave. For each of them she: 2.1. Generates $K_2$. ...
662 views

### Okay to use OpenSSL to encrypt then sign a message?

I am planning on encrypting a message then signing the message so the recipient can authenticate the source. Reading this article has me concerned that I'm doing something wrong. My current plan is ...
518 views

First, just to make sure I understand "salting" correctly: You randomly generate a string to append to the password before hashing it, so as to increase its length and make precomputed tables much ...
314 views

Sorry if this is a noob questions, but I finally figured out how to implement the Tiny Encryption Algorithm in C++. My question is what to do about padding the key and the plaintext? I know that ...
228 views

### Does a hash function in chaining mode or in counter mode make a better pseudo-random number generator?

I have two pseudorandom generators: $f_1$ takes a random seed $l_0||r_0$ $\in \{0,1\}^{160}$ as input and outputs $r_1||r_2|| \dots ||r_k$, where $l_i||r_i = \operatorname{SHA-1}(l_{i-1}||r_{i-1})$ ...
334 views

### What's the reason for applying the hash twice when hashing with salt?

One of the typical approaches to computing a salted hash is this: hash(salt+hash(secret)) where hash is something like SHA-256 hash function - taking any size ...
172 views

### How hard is to find the operators of an addition knowing the sum of them?

I want to learn whether or no there is a cryptographic primitive,scheme assumption that is based on the following hard problem if it is hard . By hard we mean that we have a polynomial adversary: The ...
141 views

### Idea for secure password hash-likes, is this feasible/usable/workable?

(Hand moved from stackoverflow.com,due to suggestion) Since breaking password hashes has become a new passtime for scriptkiddies, I thought of the problem and came up with a novel(?) idea. store ...
194 views

### Attack vectors introduced by compilers

I have a question about attacks on the implementation of cryptographic code that are enabled by compilation and compiler-optimisations. I am aware of this. Would anyone be able to point me to other ...
355 views

### How secure is my OTP program?

I'm writing an One-Time Pad encryption program, because I got really interested in the idea of " encryption which has been proven to be impossible to crack if used correctly". I'm writing the program ...
1k views

### Why do block ciphers need a non-linear component (like an S-box)?

Why is there a requirement of "Non-Linear functions" as a component of many popular block ciphers (e.g. the S-box in DES or 3DES)? How does it make the cipher more secure? The only intuition I have ...
129 views

### In S/MIME, are the same certificates always used to sign and encrypt messages?

My assumption is that S/MIME almost always utilizes certificates as follows: My certificate can be used to allow people to encrypt messages and send them to me. My certificate (the same ...
153 views

### How does DJB's nistp224 manage to fit compressed points into 224 bits?

DJB's nistp224 program purports to be an implementation of elliptic curve Diffie-Hellman relative to the standard NIST P-224 elliptic curve. To the best of my ...
383 views

### File Encryption/Decryption in ECB mode [duplicate]

Possible Duplicate: Removing Padded Value in Decrypted Message I tried to encrypt and decrypt a file in ECB mode using AES Algorithm but I encountered one problem during decryption, I don't ...
49 views

### SHA-512 hash collisions [duplicate]

Possible Duplicate: Is SHA-512 bijective when hashing a single 512-bit block? Is there any guarantee that there are no collisions for all 512-bit input values for SHA-512 (every 512-bit ...
2k views

### Removing Padded Value in Decrypted Message

How to remove padded value in Decrypted Message? I am using AES Algorithm. Let's take this as the decrypted message: "abcdefghijklmn " There is a 2 space in ...
172 views

### Do these 2 KSA shortcuts weaken RC4?

Alice securely gives Bob a secret key so they can exchange 10 different messages encrypted with RC4. (Messages will include a counter for uniqueness and a MAC for authentication.) For each message ...
140 views

### Proof of work scheme with one and only one correct answer

I need a problem that has one and only one solution, such that the solution is hard to find but easy to verify. I need to be able to generate the problem deterministically from a random seed. So ...
971 views

### How can 3DES encryption use decryption in the middle step?

I have been reading about the 3DES algorithm and I cannot understand one part. In 3DES we do following operation: $$C=E[K_3,D[K_2,E[K_1,P]]].$$ Where $C$ is ciphertext, $P$ is plaintext, $E$ is DES ...
113 views

### How can I protect against the failure of a block or symmetric cipher?

Can I protect against the failure of a block or symmetric cipher by chaining different techniques together? If so what implementation details should I be aware of? Are some combination of ciphers ...
825 views

### Is RSA in a ECB-like-mode safe for bulk encryption?

Let's say I would like to communicate with my friend using asymmetric/public-key encryption, e.g. RSA. (Note: I do realize that in practice this is done through an intermediate symmetric key, but ...
2k views

### Are there any simple and yet secure encryption algorithms?

Being very new to C++ and cryptography, I finally managed to implement a version of the Vinegere algorithm. I would like to try something a bit more complicated. I have looked at AES and DES and ...
190 views

### Using compression to test encryption

Is the uncompressibility of encrypted data a necessary property for a good cryptographic algorithm? To make a crude experiment, I encrypted an 8K file with all 'A' and then compressed both the ...
210 views

### Is this streamable combination of encryption and MAC secure?

I want to combine encryption and MAC. For encryption I use AES-256 with CBC and PKCS5Padding. For MAC I use HmacSHA512. I use the Encrypt-then-Mac approach (calculate MAC over the ciphertext and ...
250 views

### K out of N encryption

A friend just showed me how to combine padlocks to achieve a lock that opens when k out of n people turn their keys. I was ...
728 views

### “Signing” with public key

For this question, the following caveats and assumptions hold: There exists a 2048-bit RSA key pair used exclusively for signing/verification The private key is kept completely private There exists ...
523 views

### Replay attack prevention under strict conditions

Say I have a request-response protocol and the task to make it immune to replay attacks. The requirements are as follows: The defense mechanism cannot rely on the clocks of the parties. The defense ...
260 views

### LFSR dynamic mutation

In normal LFSR, the state is a function of the initial seed, taps positions and time, nothing else. I've seen a modification of LFSR that works like this: ...
965 views

### How to get the keyword from a keyword cipher?

I was given a ciphertext and now I am trying to break it via looking for the keyword. This is a keyword cipher. So: PlainEnglish: ABCDEFGHIJKLMNOPQRSTUVWXYZ If ...
285 views

### How to properly add ECDSA private keys?

I'm currently working on an application that requires me to add two ECDSA private keys in order to make a new private key. The result has to have the property, that its corresponding public key is the ...
3k views

### In the SHA hash algorithm, why is the message always padded?

In the SHA hash algorithm the message is always padded, even if initially the correct length without padding; the padding is of the form "1" followed by the necessary number of 0s. Why is it ...
122 views

### When to prefer exchanging cryptographic certificates over exchanging only public keys?

Let's think of the following case: A group of peers want to exchange messages with each other. They use public-key cryptography to sign and encrypt messages. Anyone with any name can join the ...