instruction stringlengths 15 30k |
|---|
Let's get terminology right. If you talk of "unknown _s_" then _s_ is _not_ a salt; when some piece of data is secret, we call it a _key_. And your "hash function" is then a [MAC][1]. In the context of "password hashing", such things are sometimes called "peppering" (as always, technical terminology is, at its core, a ... |
***H(s,r)=d*** is a function that hashes the string ***s*** with a salt ***r***, giving the result ***d***.
Hashing functions are not injective, so there isn't a reverse function ***H'(d,r)=s***.
Therefore to prove that *d* is a valid hash for the string *s*, is it necessary to use a function ***V(d,s)⟶{0,1}*** t... |
Knowing a valid salted hash for an unknown secret, is it possible to compute another valid hash? |
I want study more about cryptography reading papers, but I have a problems to understand few concepts: security notions, random oracle model, IND-CCA, ... etc. I began study this concepts by internet: wikipedia, sites etc, but I like have a **didactic** book to learn this concepts. Please anybody will be able to recomm... |
I'm building a basic HSM out of an Arduino, and am using the following scheme to store data:
- Master symmetric key $k_m$ stored in firmware (secure bit set to prevent trivial extraction).
- Secondary symmetric keys $k_s$ stored as plaintext in web application database, one per user.
- HSM record key $k_r$ gene... |
***H(s,r)=d*** is a function that hashes the string ***s*** with a salt ***r***, giving the result ***d***.
I will also assume that the salt ***r*** can be always be determined by the digest ***d***.
Hashing functions are not injective, so there isn't a reverse function ***H'(d,r)=s***.
Therefore to prove that *... |
This result is proven in the following research papers:
* Johan Hastad, Mats Naslund. [The Security of all RSA and Discrete Log Bits](http://www.nada.kth.se/%7Ejohanh/hnrsaacm.pdf). Journal of the ACM, Oct 2003, pp.1--45.
* W. Alexi, B. Chor, O. Goldrech, C. Schnorr. [RSA and Rabin functions: Certain parts are... |
This result is proven in the following research papers:
* Johan Hastad, Mats Naslund. [The Security of all RSA and Discrete Log Bits](http://www.nada.kth.se/%7Ejohanh/hnrsaacm.pdf). Journal of the ACM, Oct 2003, pp.1--45.
* W. Alexi, B. Chor, O. Goldrech, C. Schnorr. [RSA and Rabin functions: Certain parts are... |
The $1^k$ is a formalism that's only there to make the theoreticians happy. You can safely ignore it.
Why is it there? For totally stupid reasons. They want to the security of the scheme to be parametrizable (totally reasonable so far): for instance, if you want 80-bit security, you should be able to pick the par... |
The $1^k$ is a formalism that's only there to make the theoreticians happy. You can safely ignore it. When you actually implement the cryptosystem, you don't represent it: you omit it completely from the actual implementation.
I wish I could leave it at that, because this is nothing deep: it's just something stupi... |
In my lecture, the lecturer said:
Let $K$ be the key generation algorithm. Given a security parameter represented in unary, $1^k$, $K(1^k)$ will output a keypair $(pk; sk)$, known as the public key and the private (or secret) key, respectively.
My question is: When I want to implement the cryptosystem, how shou... |
Why does key generation take an input $1^k$, and how do I represent it in practice? |
The $1^k$ is a formalism that's only there to make the theoreticians happy. You can safely ignore it. When you actually implement the cryptosystem, you don't represent it: you omit it completely from the actual implementation.
I wish I could leave it at that, because this is nothing deep: it's just something stupi... |
The $1^k$ is a formalism that's only there to make the theoreticians happy. You can safely ignore it. When you actually implement the cryptosystem, you don't try to pass the string $1^k$; instead, you pass $k$, the security parameter (a representation of how much cryptographic strength is desired from the key generat... |
***H(s,r)=d*** is a function that hashes the string ***s*** with a salt ***r***, giving the result ***d*** (possibly embedding ***r*** as a subfield).
I will also assume that the salt ***r*** can be always be determined by the digest ***d***.
Hashing functions are not injective, so there isn't a reverse function **... |
The primary problem with encrypt-then-sign (signing the ciphertext) relates to the difference between signing for the purpose of assigning responsibility vs for the purpose of taking credit. Encrypt-then-sign is OK for the former but not for the latter. The issue is quite subtle.
In particular, in your protocol, t... |
In my lecture, the lecturer said:
> Let $K$ be the key generation algorithm. Given a security parameter represented in unary, $1^k$, $K(1^k)$ will output a keypair $(pk; sk)$, known as the public key and the private (or secret) key, respectively.
My question is: When I want to implement the cryptosystem, how sh... |
Designing an HSM or other secure device is relatively easy; making it reliable even in the absence of adversary requires careful engineering; making it safe against adversaries with some level of physical access is hard; demonstrating that it is safe (for some definition of that) is even harder.
One thing to worry a... |
If you got an expression that resembles $\{1\}^n$ (or $1^n$) at a place in a surrounding expression where you would expect an $n$-bit bit string to be, the $\{1\}^n$ expression means a string of $n$ bits each with the bit value $1$.
Conversely, $\{0\}^n$ means a string of $n$ zero valued bits, and $\{0,1\}^n$ just m... |
If you got an expression that resembles $\{1\}^n$ (or $1^n$) at a place in a surrounding expression where you would expect an $n$-bit bit string to be, the $\{1\}^n$ expression means a string of $n$ bits each with the bit value $1$.
Conversely, $\{0\}^n$ means a string of $n$ zero valued bits, and $\{0,1\}^n$ just m... |
If you got an expression that resembles $\{1\}^n$ (or $1^n$) at a place in a surrounding expression where you would expect an $n$-bit bit string to be, the $\{1\}^n$ expression means a string of $n$ bits each with the bit value $1$.
Conversely, $\{0\}^n$ means a string of $n$ zero valued bits, and $\{0,1\}^n$ just m... |
I want to do a one-sided integer commitment scheme. I.e. the whole process must be non-interactive where I at one point first publicly reveal some data and then at a later time reveal the commited integer which then can be verified.
In the [pedersen commitment scheme][1] we have six pieces of data p, c, g, h, x, r. ... |
Have I understood pedersen commitment correctly? |
If you got an expression that resembles $\{1\}^n$ (or $1^n$) at a place in a surrounding expression where you would expect an $n$-bit bit string to be, the $\{1\}^n$ expression means a string of $n$ bits each with the bit value $1$.
Conversely, $\{0\}^n$ means a string of $n$ zero valued bits, and $\{0,1\}^n$ just m... |
***H(s,r)=d*** is a function that hashes the string ***s*** with a salt ***r***, giving the result ***d*** (possibly embedding ***r*** as a subfield).
I will also assume that the salt ***r*** can be always be determined by the digest ***d***.
Hashing functions are not injective, so there isn't a reverse function **... |
If you got an expression that resembles $\{1\}^n$ (or $1^n$) at a place in a surrounding expression where you would expect an $n$-bit bit string to be, the $\{1\}^n$ expression means a string of $n$ bits each with the bit value $1$.
Conversely, $\{0\}^n$ means a string of $n$ zero valued bits, and $\{0,1\}^n$ just m... |
Encrypt a single file, chunk-by-chunk, each chunk using different key.
I am a security newbie (only took 2 security courses before)
But currently I am using this encryption method for my Android application.
But somehow I think it seems like it is doing extra works without adding extra level of security.
Step... |
Encrypt a single file, chunk-by-chunk, each chunk using different key.
I am a security newbie (only took 2 security courses before)
But currently I am using this encryption method for my Android application, which perform client-side encryption and upload each encrypted chunk into different cloud storage (Dropbox... |
**Step 1**: good job, this is the right way. You can also use bcrypt or scrypt for extra resistance. Make sure you have chosen sufficiently strong parameters, that is, 64-bit salt and 10000 rounds *absolute minimum*.
**Step 2**: no! once you have a strong derived master key, you don't need to apply PBKDF2 on any key... |
Encrypt a single file, chunk-by-chunk, each chunk using different key.
I am a security newbie (only took 2 security courses before)
But currently I am using this encryption method for my Android application, which perform client-side encryption and upload each encrypted chunk into different cloud storage (Dropbox... |
I have a digital signature was created using the following algorithm: a SHA-256 hash of the body of the message is calculated. It is then signed using an RSA private key and the result is base64-encoded.
Now, I have the RSA public key corresponding to that private key which was used to encrypt the hash. I want to de... |
I have a digital signature that was created using the following algorithm: a SHA-256 hash of the body of the message is calculated. It is then signed using an RSA private key and the result is base64-encoded.
Now, I have the RSA public key corresponding to that private key which was used to encrypt the hash. I want ... |
This is a follow up to [Is It Possible To Reconstruct a Cryptographic Hash's Key](http://stackoverflow.com/questions/2298018/is-it-possible-to-reconstruct-a-cryptographic-hashs-key)
I am using a SHA-256 HMAC function on a single-word input: sha256hmac(privatekey,word) = output. The private key length is 128 bits, it... |
Almost all other languages can call C code, so using C is a safe bet.
[Serpent][1], [Twofish][2], [Threefish][3] and [scrypt][4] _all_ provide C implementations. (See the links.) Some even provide optimized code. Writing objC or C++ wrappers seems unnecessary since both can call C funtions.
The `sleep(3)` library f... |
I want to do a one-sided integer commitment scheme. I.e. the whole process must be non-interactive where I at one point first publicly reveal some data and then at a later time reveal the committed integer which then can be verified.
In the [pedersen commitment scheme][1] we have six pieces of data $p$, $c$, $g$, $h... |
***H(s,r)=d*** is a function that hashes the secret string ***s*** with a salt ***r***, and returns a digest ***d***.
***r*** may be arbitrarily chosen and each ***r*** returns a different ***d***.
For any ***d***, ***r*** is known from a function ***R(d)=r***.
Both ***H*** and ***R*** are not reversible, (the... |
$H(s,r)=d$ is a function that hashes the secret string $s$ with a salt $r$, and returns a digest $d$.
$r$ may be arbitrarily chosen and each $r$ returns a different $d$.
For any $d$, $r$ is known from a function $R(d)=r$.
Both $H$ and $R$ are not reversible, i.e. there isn't a neither a reverse function $H'(d,r)... |
How much the security of one time-pad will decrease if I used one digest from 0-9 instead of 0-26...
ex. pt = blue , key = 5 9 4 6
>02 12 21 05
>5 9 4 6
>07 21 25 11
>g u y k
so blue+5946=guyk
Is that as secure as if i use numbers from 1-26
And will blue + 5946 = the unbreakable one time-... |
CBC-MAC, with fixed length message.
Is it safe to return all ciphered blocks instead of the last?
My intuition says it is less secure, since is gives an attacker more information.
But how could one attack this scheme? |
When salting - Does it matter what length the salt is?
If so - what should it be? (-the length, that is.)
Should it be random?
(An answer for any one is welcome.) |
What length should the salt be when encrypting or signing with RSA? (etc) |
When salting - Does it matter what length the salt is? If so - what should it be? (-the length, that is.)
(Another point: Should it be random?)
|
What length should the salt be when encrypting or signing with RSA? |
can we reuse same ECC key on TLS for long terms or it must be used just once? *(i mean can we use ECC like RSA?)*
is there patent free ECC implementation ? |
Elliptic Curve is DH function or PKI? |
First and foremost: it is a bad idea to invent a method to sign or encrypt with RSA (or any crypto). Standards like [PKCS#1][1] or [ISO/IEC 9796-2][2] are here for that purpose, and even these occasionally have [more][3] or [less][4] subtle flaws.
Given comments, I'll assume that the question is about an RSA encrypt... |
First and foremost: it is a bad idea to invent a method to sign or encrypt with RSA (or any crypto). Standards like [PKCS#1][1] or [ISO/IEC 9796-2][2] are here for that purpose, and even these occasionally have [more][3] or [less][4] subtle flaws.
Given comments, I'll assume that the question is about an RSA encrypt... |
Yes, TLS supports [ECDSA][1] for signing and [ECDH][2] for key exchange. You can read about it [RFC 4492][3]. Notice you don't get RSA, but you get signing and key exchange which are major functions of TLS.
Related material:
[How do I create an ECDSA certificate with the OpenSSL command-line][4]
[SSH key-type,... |
I've read almost everywhere that AES-256 can be used for Top Secret material (in the US). Is it really used or is it some kind of decoy to hide the more advanced algorithm they might use ?
|
Is AES really used for Top Secret stuff? |
It's more a theoretical question of how would you approach it. All you know about the ciphertext it's was generated with a historical cipher. The ciphertext appears to be random, BUT it's divided into sets of six letters. By historical ciphers I mean: mono (Ceasar), polyalphabetic (Vigenere), homophonic or polygraphic ... |
Decoy for whom?
Security, and cryptography specifically, has a need for public scrutiny. It's been proven time and time again that hiding the nature of the protocol/algorithm/scheme doesn't provide any tangible security. Kerchoff's principle (http://en.wikipedia.org/wiki/Kerckhoffs%27_principle) explains this: A cr... |
Your question might be missing one plausible reason for governments to keep certain aspects of their cryptographic systems secret (besides the key), namely that their interest in learning the secrets of the opposition, might be as strong as their interest in keeping their own secrets to themselves. Hence, there are two... |
What is the best way to generate two (independent),encryption keys (symmetric) from one user entered password?
Would using both scrypt and pbkdf2 achieve this? |
Is there any difference except speed and key length? |
What's the difference between AES and earlier algorithms? |
Some ciphers are talked about [here][1], but I don't see an answer, are they strong enough, or are non-computer ciphers more or less just a toy and one should abandon using them for practical purposes?
[1]: http://crypto.stackexchange.com/questions/844/is-there-a-secure-cryptosystem-that-can-be-performed-mentall... |
Is there any strong enough pan-and-paper or mind cipher? |
Some ciphers are talked about [here][1], but I don't see an answer, are they strong enough, or are non-computer ciphers more or less just a toy and one should abandon using them for practical purposes?
[1]: http://crypto.stackexchange.com/questions/844/is-there-a-secure-cryptosystem-that-can-be-performed-mentally |
Is there any strong enough pen-and-paper or mind cipher? |
Finding a decent explanation of rainbow tables was something I struggled with, so firstly I'll cover what they are. I will get to your question in the end. My sources for this are [this guide][1] and the [wikipedia article][2].
**Why can't I just use a big bucket of hashes?**
Firstly the naive way to build a reve... |
i am trying to implement shamir`s secret sharing in c++.
I have got the generation of shares out.
However i am very confused with the reconstruction of shares, i get the part on how three users construct the secret back. But however if there are more than 3 users needed to construct the secret back. How do i implem... |
I want to store a password securely on a storage (suppose in a usual unencrypted file).<br/>
I use this password as AES key to encrypt itself (using AES-ECB) & then store it on the media (the password length is at most 16 bytes).<br/>
When user wants to confirm it's identity, I decrypt this saved encrypted content wi... |
how much is secure to encrypt a password using itself (as encryption key) for storing it on a unsecure media? |
SRP seems to be a very good password authentication protocol, compared to any other things used now. So why is there no popular implementations, or even no working secure implementations?
I tried to set up [TLS-SRP protocol][1], but it haven't worked for me.
[1]: http://superuser.com/questions/567594/how-to-... |
Why SRP is not widely used? |
First and foremost: it is a bad idea to invent a method to sign or encrypt with RSA (or any crypto). Standards like [PKCS#1][1] or [ISO/IEC 9796-2][2] are here for that purpose, and even these occasionally have [more][3] or [less][4] subtle flaws.
Given comments, I'll assume that the question is about an RSA encrypt... |
First and foremost: it is a bad idea to invent a method to sign or encrypt with RSA (or any crypto). Standards like [PKCS#1][1] or [ISO/IEC 9796-2][2] are here for that purpose, and even these occasionally have [more][3] or [less][4] subtle flaws.
Given comments, I'll assume that the question is about an RSA encrypt... |
Is there any difference except speed and key length from user's point of view?
Or does AES have something that ideal block cipher doesn't have? |
What's the difference between AES and earlier block ciphers? |
Is there any difference except speed and key and block size from user's point of view?
Or does AES have something that ideal block cipher doesn't have? |
Yes, TLS supports [ECDSA][1] for signing and [ECDH][2] for key exchange. You can read about it [RFC 4492][3]. Notice you don't get RSA, but you get signing and key exchange which are major functions of TLS.
Related material:
[How do I create an ECDSA certificate with the OpenSSL command-line][4]
[SSH key-type,... |
This is highly insecure.
For instance, if you see the word `guyk` in the ciphertext, what could the corresponding plaintext word be?
* With your scheme (where each letter is enciphered by adding a number between 0..9 to it modulo 26), there are only 109 English words that could have led to it. (Those 139 possibi... |
Is the following statement true?
If $G: \{0,1\}^k \rightarrow \{0,1\}^n$ is a PRG, then so is $G':\{0,1\}^{k+l} \rightarrow \{0,1\}^{n+l}$ defined as $$G'(x.x')=G(x).x'$$ where $x \in \{0,1\}^k$ and $x' \in \{0,1\}^l$. We are using $.$ to denote concatenation.
My thought is that since $x'$ is not processed throug... |
This is highly insecure.
For instance, if you see the word `guyk` in the ciphertext, what could the corresponding plaintext word be?
* With your scheme (where each letter is enciphered by adding a number between 0..9 to it modulo 26), there are only 139 English words that could have led to it. (Those 139 possibi... |
Yes, scrypt achieves this. Scrypt has a variable-length output, so just generate as much output as you need. For instance, you can ask it for 256 bits of output, then use the first 128 bits for one key and the second 128 bits for the other key.
While PBKDF2 also has a variable-length output, I do not recommend tha... |
What is the best way to generate two independent symmetric keys from one user-entered password or passphrase?
Would using both scrypt and pbkdf2 achieve this? |
Yes, scrypt achieves this. Scrypt has a variable-length output, so just generate as much output as you need. For instance, you can ask it for 256 bits of output, then use the first 128 bits for one key and the second 128 bits for the other key.
While PBKDF2 also has a variable-length output, I do not recommend tha... |
Suppose you randomly generate large primes p and q as in RSA, and then tell me N=pq but not p or q.
Then, you would like to actually let me factor N, except you should tell me as few bits of information as possible. Say p and q are 4096 bits, then how many bits do you need to tell me in order for me to factor N in f... |
I am trying to calculate an x, such that t = g^x mod p (I need to crack a weak elgamal encryption for university). I found gdlog, but I cant figure out how I can use the input to calculate my x. Here is what we got (from gdlogs example code):
>p:1000000000000000000000000000057 //prime number, modulus
>q:290240017... |
I need to sign the numbers from 1 to 1 billion (literally this, it's not an analogy) using a digital signature and then send these numbers in a particular order to someone. The message is not private and the receiver should be able to verify its authenticity without having to reply; it's a one-way public communication ... |
Are digital signatures secure for signing lots of small messages? |
A cryptosystem is using AES-128 in CCM mode with random IV.
Suppose an attacker capable of asking the cryptosystem to encrypt a single plaintext as many times as he wants. The attacker knows what the plaintext is. The attacker can only encrypt that single plaintext (ie, he cannot chose a different one to be encrypte... |
A cryptosystem is using AES-128 in CCM mode with random IV.
Suppose an attacker capable of:
- asking the cryptosystem to encrypt a single plaintext as many times as he wants; and
- asking the cryptosystem if any ciphertext is valid (ie, if it decrypts to some plaintext)
The attacker knows what is the single... |
I am trying to implement Shamir's secret sharing in C++.
I have got the generation of shares working.
However, I am very confused with the reconstruction of shares. I get the part on how three users can reconstruct the secret. But what if there are more than 3 users needed to reconstruct the secret? How do I implem... |
I have noted some sources indicate that when using a KDF like [PBKDF2](https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Protocol/KDF.py) some advocate injecting the salt at the time of execution - like this:
dv = salt + PBKDF2(salt + password, salt)
Versus the "plain" usage of
dv = PBKDF2(pas... |
Injecting salt into PyCrypto KDF - useful? |
I have noted some sources indicate that when using a KDF like [PBKDF2](https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Protocol/KDF.py) some advocate injecting the salt at the time of execution - like this:
dv = salt + PBKDF2(salt + password, salt)
Versus the "plain" usage of
dv = PBKDF2(passw... |
I have noted some sources indicate that when using a KDF like [PBKDF2](https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Protocol/KDF.py) ([alternatively](https://github.com/mitsuhiko/python-pbkdf2/blob/master/pbkdf2.py)) some advocate injecting the salt at the time of execution - like this:
dv = salt + P... |
How to hash a structure that needs to include that hash's outcome? |
First, a hash does not provide integrity. You would need a [MAC][1] (like [HMAC][2]) or a digital signature to ensure the message hasn't changed in transit.
You'll have to put some standard value (say all zeros) into the field which holds the MAC, compute the MAC, then insert the value. Otherwise you have a chicken... |
In a paper they write once, $(\mathbb{Z}_n^*)^2$. Is this the group of quadratic residues or is it something else? |
What does $(\mathbb{Z}_n^*)^2$ mean? |
I have noted some sources indicate that when using a KDF like [PBKDF2](https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Protocol/KDF.py) ([alternatively](https://github.com/mitsuhiko/python-pbkdf2/blob/master/pbkdf2.py)) some advocate injecting the salt at the time of execution - like this:
dv = salt + P... |
First, a hash does not provide integrity. You would need a [MAC][1] (like [HMAC][2]) or a digital signature to ensure the message hasn't changed in transit.
You'll have to put some standard value (say all zeros) into the field which holds the MAC, compute the MAC, then insert the value. Otherwise you have a chicken... |
I have noted some sources indicate that when using a KDF like [PBKDF2](https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Protocol/KDF.py) ([alternatively](https://github.com/mitsuhiko/python-pbkdf2/blob/master/pbkdf2.py)) some advocate injecting the salt at the time of execution - like this:
dv = salt + P... |
I've heard that hash algorithms like `bcrypt` are more secure because they take longer to complete, and therefore take much longer to prute force, without a noticable delay for legitimate users. Would using a faster alghtithm, such as SHA-256, multiple times, be secure? For example:
hash = "password"
for x ... |
Many consecutive hashes to slow down brute force attack? |
Instead of that home-grown scheme, I would use [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2) instead if you simply are sold on the idea of iterated hash schemes. It uses an such a scheme, although not exactly the one you have described, and is well-studied and considered secure.
However, PBKDF2 doesn't offer many a... |
Is there a way to get(derive) these formulas (http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html) by yourself? Thanks a lot beforehand. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.