instruction
stringlengths
15
30k
According to [this source][1], bitcoin mining nowadays (Nov. 2015) tops $50\cdot10^{15}$ hashes per seconds, where one hash is two nested SHA-256, that is over $2^{84.7}$ SHA-256 per year. I'm guessing that the NSA could do much better with a fraction of it's budget. Here is this data redrawn in SHA-256 per year wit...
My question maybe will be stupid, but my problem is that I do not understand why stream ciphers need a key and also a nonce. As far as I understand, the keystream is generated with the nonce. The same key can be reused with a different nonce. Wouldn't be simpler just to use a new key each time? If I understand good,...
Why do stream ciphers use a nonce?
When performing a CCA, the adversary gets the public key. At some point, he will send a message m to the challenger, and the challenger will send back either $E_{pk}(m)$ or $E_{pk}(r)$, where r is some random string of same length as m. The goal of the adversary is now to guess which one the challenger sends back. Howe...
Confused about how chosen ciphertext attacks work?
On the section 5.4 of the paper [Improved Security for a Ring-Based Fully Homomorphic Encryption Scheme][1], the authors explain how to discard some bits of the ciphertexts to get smaller ciphertexts and smaller evaluation keys. The function *Discard* simply takes a ciphertext $c$ and an integer $i$ (number of words...
According to [this source][1], bitcoin mining nowadays (Nov. 2015) tops $50\cdot10^{15}$ hashes per seconds, where one hash is two nested SHA-256, that is over $2^{84.7}$ SHA-256 per year. I'm guessing that the NSA could do much better with a fraction of it's budget. Here is this data redrawn in SHA-256 per year wit...
As far as I know, RSA public exponent(e) should be one of {3,17,65537}.<br> However, I found PuTTYgen-created RSA public exponent(e) is 0x25(37) by default,as follows, (PuTTYgen version: 0.66) [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/gzZy4.png I am curious why PuTTY uses 0x25...
Why is PuTTYgen-created RSA public exponent(e) not in {3,17,65537}?
I am reading a content, and am not sure if I follow how they come up with the maximum data size which can be signed by an RSA key. The author states: "...if you are trying to sign a message using a 2048-bit RSA key whose public key size is 256 bytes, the maximum length is 256 bytes minus the encoding parameters, in thi...
Suppose I want to keep a client's password database secure (not in plaintext), while still having access to the plaintext password. Now I generates a public/private keypair. Then I send the public key to all servers, while keeping the private key on a heavy-secured, airgapped computer. Now, instead of salting and ha...
I just started learning Diffie-Hellman Key Exchange. I couldn't get the reason of making alpha and private key for Alice and Bob constrained between 2 and the prime number generated minus 2. Why should it be 2 less than the prime? Is there a specific reason for this?
Suppose I want to keep a client's password database secure (not in plaintext), while still having access to the plaintext password. Now I generates a public/private keypair. Then I send the public key to all servers, while keeping the private key on a heavy-secured, airgapped computer. Now, instead of salting and ha...
In algorithms like Dixon's factorization a factor base is used, which contains all primes below a bound. Then calculates $x^2 \mod n$, and then checks it is in factor base or not. Suppose $P$ is the factor base for bound $B$. We calculate the value $x^2 \mod n$, then how to check whether the result contains o...
Say we have a computationally secure Message Authentication Code scheme (Gen, Tag, Ver). Let $Tag'_k(m):=$ first half bits of $Tag(m)$. Let's assume the range of tags is $n$bits. Is (Gen, Tag', Ver) secure? An efficient adversary that breaks (Gen, Tag, Ver) can't be constructed using an effecient adversary th...
Is this MAC scheme secure?
The reason for both is that the generated values are trivial to detect / exploit and should be avoided *and* your RNG is deeply flawed if you actually get those values because the chance for this lies around $2^{-2000}$ if you use an appropriate parameter set. ---------- Now for the math:<br> You need to choos...
I just started learning Diffie-Hellman Key Exchange. I couldn't get the reason of making $\alpha$ and private key for Alice and Bob constrained between $2$ and the prime number generated minus $2$ (=$p-2$). Why should it be $2$ less than the prime? Is there a specific reason for this?
Suppose I want to keep a client's password database secure (not in plaintext), while still having access to the plaintext password. Now I generates a public/private keypair. Then I send the public key to all servers, while keeping the private key on a heavy-secured, airgapped computer. Now, instead of salting and ha...
According to [this source][1], bitcoin mining nowadays (Nov. 2015) tops $500\cdot10^{15}$ hashes per second, where one hash is two nested SHA-256; that is over $2^{84.7}$ SHA-256 per year. I'm guessing the NSA could do much better with a fraction of its budget. Here is this data redrawn in SHA-256 per year with a $\...
According to [this source][1], bitcoin mining nowadays (Nov. 2015) tops $500\cdot10^{15}$ hashes per second, where one hash is two nested SHA-256; that is over $2^{84.7}$ SHA-256 per year. I'm guessing the NSA could do much better with a fraction of its budget. Here is this data redrawn in SHA-256 per year with a $\...
Is there an assumption that says from a tag $e(g,g_1)^{rx}$ it is difficult to forge it with some x': $e(g,g_1)^{rx'}$, as long as you cannot solve DL in $\mathbb{G}_1$ or $\mathbb{G}_2$? It is obvious that the only way to forge is to extract the randomness $r$ such that you forge with $e(g,g_1)^{rx}\cdot e(g,g_1)^...
It's not clear here exactly what you mean by a forgery. Are you trying to define a signature scheme? By the way: you can always build a forgery for $2x$ by computing $(e(g, g_1)^{rx})^2$. You don't need to extract the randomness in order to do this. Also, in the bilinear world, assuming discrete log is usually no...
I am restricted on a certain environment involving PHP and am currently unable to implement new memory hard hashes such as scrypt (and I am not trying to compete with the likes of scrypt). My current key derivation is simply an iteration of HMAC (password + salt). But it seems that using AES or other encryption ci...
I am restricted on a certain environment involving PHP and am currently unable to implement new memory hard hashes such as scrypt (and I am not trying to compete with the likes of scrypt). My current key derivation is simply an iteration of HMAC (password + salt). But it seems that using AES or other encryption ci...
Is there an assumption that says from a tag $k\cdot e(g,g_1)^{rx}$ ($k,r$ are secret) it is difficult to forge it with some x': $k\cdot e(g,g_1)^{rx'}$, as long as you cannot solve DL in $\mathbb{G}_1$ or $\mathbb{G}_2$? It is obvious that the only way to forge is to extract the randomness $r$ such that you forge w...
I am restricted on a certain environment involving PHP and am currently unable to implement new memory hard hashes such as scrypt (and I am not trying to compete with the likes of scrypt). My current key derivation is simply an iteration of HMAC (password + salt). But it seems that using AES or other encryption ci...
Suppose I want to keep a client's password database secure (not in plaintext), while still having access to the plaintext password. Now I generates a public/private keypair. Then I send the public key to all servers, while keeping the private key on a heavy-secured, airgapped computer. Now, instead of salting and ha...
Simple question, in order to reduce such huge exponents in modular arithmetic, is repeated squaring used in RSA or is there a better way? (I would put an example but I'm unsure how to format the math) Thanks
Does the RSA algorithm use repeated squaring?
I have started learning about Elliptic curve cryptography. Since the key size required in ECC is relatively lesser than the key size in RSA to provide the same amount of strong encryptions, I wonder wouldn't it make it vulnerable to brute force attack?. I'm not very confident of the ways in which a key can be crack...
ECC keys vulnerable to brute force attack?
I have started learning about Elliptic curve cryptography. Since the key size required in ECC is relatively lesser than the key size in RSA to provide the same amount of strong encryptions, I wonder wouldn't it make it vulnerable to brute force attack? I'm not very confident of the ways in which a key can be cracked...
Say we have a computationally secure Message Authentication Code scheme (Gen, Tag, Ver). Let $Tag'_k(m):=$ first half bits of $Tag_k(m)$. Let's assume the range of tags is $n$bits. Is (Gen, Tag', Ver) secure? An efficient adversary that breaks (Gen, Tag, Ver) can't be constructed using an effecient adversary ...
I would like to encrypt a series of small integers one by one. The range of them is about 0~10^8. The output **must be** non-negative int64_t integers. Since Blowfish is 64-bit cipher, I prefer to use it as symmetric encryption algorithm. The problems are: 1. Since 32-63 bits of input is always 0, do I need ...
How to force non-negative int64_t output for blowfish encryption with int32_t input?
The answer is in the source, file [sshrsag.c, line 9][1]: > `#define RSA_EXPONENT 37 /* we like this prime */` This value $e=37$ matches the conditions for a reasonable fixed RSA public exponent: - $e$ is odd, - $e$ is at least $3$, - $e$ is reasonably small. The later condition - is good for s...
Encrypted fields are loaded from disk file to process memory only after file's HMAC validation is successful. Data is still encrypted in memory and will be decrypted later, on demand, when it needs to be displayed to the user (cipher is initialized on process start). The system also allows user to add new data which wi...
Should I authenticate memory data which was loaded from authenticated disk file?
> How do cryptography in SSH(2) work? This is a very broad question. If you're interested in the details, then read the relevant RFCs that describe the SSH protocol. In particular: - [RFC 4253 - The Secure Shell (SSH) Transport Protocol](https://tools.ietf.org/html/rfc4253) - [RFC 4252 - The Secure Shell (SSH)...
How can I use the whole potential of DES?
I am studying RSA Dynamic Accumulator and I have a doubt: why is more simple to calculate the new accumulator value after a deletion if is known the secret ϕ(n)? Is possible to calculate the deletion only with the RSA modulus N?
I want to use a (preferably established) hash function that is backdoorable in a password database. I want to do so because I need password escrow (being able to get the cleartext back. I want to generate some form of a private/public keypair on a secure server (airgapped, physical security). I then want to send the pu...
> [D]oes adding HMAC to each encrypted field and validating it before decryption makes sense? No. Since you authenticate the data once, you can trust that it is the same as was originally encrypted and authenticated. That is, authenticating the ciphertext also authenticates the plaintext. > The goal is to make ma...
*Disclaimer: I'm fairly new to cryptography beyond the basic concepts and implementations - I don't know the terminology very well, and therefore I was unable to find a similar question posted.* Is there an encryption algorithm/protocol where any of a pre-defined set of keys/passwords will succeed in decrypting a d...
Is there an encryption algorithm/protocol where any of a pre-defined set of keys/passwords will succeed in decrypting a document? The number of keys can be fixed, say, 10 or 20 possible passwords. The context is a single application (with a single embedded document), with no server-side component. It should be share...
Is there an encryption algorithm/protocol where any of a pre-defined set of keys/passwords will succeed in decrypting a document? The number of keys can be fixed, say, 10 or 20 possible passwords. The context is a single application (with a single embedded document), with no server-side component. It should be share...
I recentely had a discussion about the redesign of our ECC code for the library I'm collaborating on and the person I was discussing with came up with Edwards and Montgomery curves over binary extension fields. I suspect he just did this because "why not?" as it seems to be straight conclusion to think they exist for t...
I am trying to understand this attack at the most basic level. I set up the following basic scenario:<br> Let the public encryption exponent, e = 3. <br> Let p, be some arbitrary but known (to the eavesdropper) padding of a couple characters. Suppose an eavesdropper has intercepted two encrypted messages $C_1$ and $...
I read several papers about user revocation in IBE recently. A common point is that when a user is revoked, some other valid users should also update their private keys. Does this mean that one identity is actually associated with many users? If not, why do other valid users still need to update the keys? I am also ...
In SCRAM ([RFC5802](https://tools.ietf.org/html/rfc5802), page 8) the client generates `ClientKey` to server, which is a derivation of the original password. This is communicated to the server in a secure fashion, which then performs a single hash operation `H(ClientKey)` and check if that's equal to `StoredKey`. That ...
> 1. Is the above example correct? If not, how can the IV to be used for decryption be determined? Yes, it is correct. The vector/mask in CBC mode is generally the previous ciphertext block. The algorithms in 2a and 2b simply extends this notion to the IV so that the CBC mode encryption doesn't have to be re-initial...
> Is there an encryption algorithm/protocol where any of a pre-defined > set of keys/passwords will succeed in decrypting a document? Not exactly a protocol, but there are formats out there that will allow this sort of thing. An example system using a similar appraoch would be LUKS which offers "key-slots" doing ex...
> Is there an encryption algorithm/protocol where any of a pre-defined > set of keys/passwords will succeed in decrypting a document? Not exactly a protocol, but there are formats out there that will allow this sort of thing. An example system using a similar appraoch would be [LUKS][1] which offers "key-slots" doi...
An [NTRU](https://en.wikipedia.org/wiki/NTRUEncrypt) key is generated essentially by multiplying a polynomial f by a polynomial g. The polynomial f is the private key; g is discarded. My question is: Is it insecure to hand out multiple public keys for the same private key, i.e. using the same f but different g's?
Multiple NTRU public keys for the same private key?
I'm looking to use password-style hashing to validate an environment, where some parts may be irrelevant. For example: requirement = 0b1010 pattern = 0b1011 mask( a, b ) = a & b hash( a ) = <any cryptographic hash> condition = hash( mask( requirement, pattern ) ) environment = 0b1110 ...
Cryptographic hash with ability to ignore specific bits based on a hidden pattern?
Which hash function is usually used in RSA?
I'm looking to use password-style hashing to validate an environment, where some parts may be irrelevant. For example: requirement = 0b1010 pattern = 0b1011 mask( a, b ) = a & b hash( a ) = <any cryptographic hash> condition = hash( mask( requirement, pattern ) ) # public environm...
I am currently studying the interesting field of homomorphic encryption. I read that from a fully homomorphic encryption function that supports both addition and multiplication you can perform any mathematical and comparison operations. Ok, but how can you do this specifically? How do you for example perform comparison...
An [NTRU](https://en.wikipedia.org/wiki/NTRUEncrypt) public key is generated essentially by multiplying the inverse of a polynomial $f$ by a polynomial $g$. The polynomial $f$ is the private key; $g$ is discarded. My question is: Is it insecure to hand out multiple public keys for the same private key, i.e. using th...
In both node.js and OpenSSL, I am seeing cipher "aes-256-gcm". However, in [NIST Special Publication 800-38D, that defines GCM](http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf), I am reading: > The underlying block cipher shall be approved, the block size shall be 128 bits, and the key size shal...
How can there be AES-256-GCM, when GCM is defined for 128-sized blocks?
Is it possible to say that the most significant bit of an RSA key is always 1? Wouldn't that weaken the key strength by exactly that one bit? I refer to the paper ["Timing Attack: What can be achieved by a powerful adversary?"](http://svn-crypto.dice.ucl.ac.be/crypto/services/download/publications.pdf.8085ac51845007...
RSA: Most significant key bit always 1?
Is it possible to say that the most significant bit of an RSA private key is always 1? Wouldn't that weaken the key strength by exactly that one bit? I refer to the paper ["Timing Attack: What can be achieved by a powerful adversary?"](http://svn-crypto.dice.ucl.ac.be/crypto/services/download/publications.pdf.8085ac...
Suppose I use the following encrypt-and-MAC construction: > $E(k_1, k_2, n, m) = \text{AES256-CTR}(k_1, n, m) \| \text{HMAC-SHA256}(k_2, m)$, where: > $k_1$ and $k_2$ are 256-bit keys > $n$ is a nonce > $m$ is an arbitrary-length message. What security losses occur if I use the MAC as the nonce? (i.e. $n...
First of all, I just implemented AES because I wanted to understand how it works and as a challange to see if I could do it and I won't use to encrypt anything important, ever. The (German) Wikipedia article of AES linked to a [flash animation][1] which demonstrated precisely how AES-128 in ECB mode worked. I implem...
Suppose I use the following encrypt-and-MAC construction: > $E(k_1, k_2, n, m) = E_\text{AES256-CTR}(k_1, n, m) \| \text{HMAC-SHA256}(k_2, m)$, where: > $k_1$ and $k_2$ are 256-bit keys > $n$ is a nonce > $m$ is an arbitrary-length message. What security losses occur if I use the MAC as the nonce? (i.e. ...
Imagine, a client encrypts a corpus of data (say documents of text) with the public key of a *Fully Homomorphic Encryption scheme (FHE)* and outsources the data to an untrusted server.Now the client wants search for a particular word in the corpus of encrypted documents and retrieve the matching documents that contain ...
Papers from Marc Stevens et al show that X509 certificates that rely on MD5 signatures can break the assumed security model, that is, it allows for a forged certificate to have the same signature as a trusted cert, see [https://marc-stevens.nl/research][1] for these papers. Both methods require the "to be signed" port...
First of all, I just implemented AES because I wanted to understand how it works and as a challenge to see if I could do it and I won't use to encrypt anything important, ever. The (German) Wikipedia article of AES linked to a [flash animation][1] which demonstrated precisely how AES-128 in ECB mode worked. I implem...
Papers from Marc Stevens et al show that X509 certificates that rely on MD5 signatures can break the assumed security model, that is, it allows for a forged certificate to have the same signature as a trusted cert, see [https://marc-stevens.nl/research][1] for these papers. Both methods require the "to be signed" port...
I think the flash implementation is wrong: (using Linux, OS X terminal etc.) echo 328831e0435a3137f6309807a88da234 | xxd -r -p > plain.dat openssl enc -e -aes-128-ecb -iv 00 -K 2b28ab097eaef7cf15d2154f16a6883c -in plain.dat -out plain.dat.out -nopad yields hd plain.dat.out ...
I think the flash implementation is wrong: (using Linux, OS X terminal etc.) **not true, see below** echo 328831e0435a3137f6309807a88da234 | xxd -r -p > plain.dat openssl enc -e -aes-128-ecb -iv 00 -K 2b28ab097eaef7cf15d2154f16a6883c -in plain.dat -out plain.dat.out -nopad yields hd plain.dat.ou...
Let ext be a single-source randomness extractor which takes a $d$-bit seed and a $n$-bit source as input and produces a $m$-bit output. Suppose we have a source $X$ with min-entropy $k$. Is it possible to re-use $X$ with different random seeds $S_1, . . . S_l$ for $l ≥ 2k$? In other words: Is $(S1, . . . S_l, ext(S_...
I think the flash implementation is wrong: (using Linux, OS X terminal etc.) **not true, see below** echo 328831e0435a3137f6309807a88da234 | xxd -r -p > plain.dat openssl enc -e -aes-128-ecb -iv 00 -K 2b28ab097eaef7cf15d2154f16a6883c -in plain.dat -out plain.dat.out -nopad yields hd plain.dat.ou...
Is it possible to say that the most significant bit of an RSA private exponent is always 1? Wouldn't that weaken the key strength by exactly that one bit? I refer to the paper ["Timing Attack: What can be achieved by a powerful adversary?"](http://svn-crypto.dice.ucl.ac.be/crypto/services/download/publications.pdf.8...
Let $ext$ be a single-source randomness extractor which takes a $d$-bit seed and a $n$-bit source as input and produces a $m$-bit output. Suppose we have a source $X$ with min-entropy $k$. Is it possible to re-use $X$ with different random seeds $S_1, . . . S_l$ for $l ≥ 2k$? In other words: Is $(S1, . . . S_l, ext(...
Let $ext$ be a single-source randomness extractor which takes a $d$-bit seed and a $n$-bit source as input and produces a $m$-bit output. Suppose we have a source $X$ with min-entropy $k$. Is it possible to reuse $X$ with different random seeds $S_1, . . . S_l$ for $l ≥ 2k$? In other words: Is $(S1, . . . S_l, ext(S...
I am only taking baby steps in RSA. If p=11, q=7 and e=3, phi(n) = 10*6 = 60 Then: d = (2 (phi(n)) + 1 ) / 3 = 121/3 Should `d` be kept as a non-integer or is such a d invalid?
RSA: must `d` be an integer?
I've been given a task to research and possibly implement so called 'Muchomor' cipher. Has anybody ever heard of this cipher? I've found only one article about it and it was in Russian. I'm quite fluent in Russian so I was able to read it; however, it was still not enough. I would appreciate any data about where to lo...
I'm wondering, if something like block cipher with big block size is memory-hard function? All memory-hard key derivation functions I've seen look more complex than that, which made me question my understanding of memory-hardness. The following function looks memory-hard (memory tradeoff looks expensive) to me: ...
I know how the s-boxes in blowfish are initialized, but how is the output sorted, I mean which bit from the input goes where in the box ? and what do mean they have 256 entries if they are 32-bit S-Boxes ?
I've read Intel's [The Difference Between RDRAND and RDSEED](https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed), but I have some open questions that are specific to usage in an application. I work with [Wei Dai's Crypto++](https://www.cryptopp.com/), which is a C++ class library...
I've read Intel's [The Difference Between RDRAND and RDSEED](https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed), but I have some open questions that are specific to usage in an application. I work with [Wei Dai's Crypto++](https://www.cryptopp.com/), which is a C++ class library...
On https://www.schneier.com/blog/archives/2009/07/another_new_aes.html Schneier discuses that there is a new related key attack on 10 rounds of and 256 "Another attack can break a 10 round version of AES-256 in 245 time, but it uses a stronger type of related subkey attack". My question is how many more rounds would...
More rounds after aes related key attack?
I am only taking baby steps in RSA. If $p=11$, $q=7$ and $e=3$, $$\phi(n) = 10*6 = 60$$ Then: $$d = (2 (\phi(n)) + 1 ) / 3 = 121/3$$ Should $d$ be kept as a non-integer or is such a $d$ invalid?
RSA: must $d$ be an integer?
**$d$ must indeed be an integer.** To calculate $d$ you need to calculate $d=e^{-1}\bmod{\phi(n)}$ which is called the [modular multiplicative inverse][1] of $e\bmod{\phi(n)}$. For $d$ be computable you need to ensure that $$\gcd(e,\phi(n))=\gcd(e,(p-1)(q-1))=1$$ holds, which isn't the case with your sample param...
A symmetric cipher design contest was started in Ukraine around 2006, and this cipher (in Ukrainian and Russian: Мухомор) was there. For specifications, look for "Applied Radioelectronics" journal "Прикладная радиоэлектроника", 2007, No 2. http://anpre.org.ua/?q=pre_2007_2 http://dspace.nbuv.gov.ua/bitstream/handl...
What are they used for? What are the structural differences of these? Need some fast help
What is the difference between LCG and Affine cipher?
What are they used for? What are the structural differences of these?
What is the difference between LCG and Affine cipher? More specific: What are they used for, and what are the structural differences between them?
I have cause to use the PRNG half of RC4, but am seriously confused as to the randomness of its' output. (Only the PRNG half.) On the one hand, there is a large body of literature finding ever greater biases in RC4's keystream. It appears that both weak and strong distinguishers can identify RC4 from a truly rando...
Is RC4's keystream random /not random?