instruction
stringlengths
15
30k
I understand that in Diffie-Hellman it should be hard to compute $a$ given $g$ and $g^a$. In computational Diffie-Hellam, it appears to be hard to compute $(g^{ab})$ from $g^a$ and $g^b$. Is it also difficult to compute the discrete log of more trivial things, such as $g^a+1$, given $g^a$ and $a$? Or the discret...
I stumbled upon this code on-line, it seems obvious to me that generating all 2^40 keys in trivial time can always be achieved as can hashing each and everyone of them, using the SHARED Salt that "Eve" could easily see: ### Here we outline: ### Sharing a SINGLE FOURTY BIT secret block, using the birthday pr...
Could we share a secret key using the Birthday problem?
I have come across this paper [On-the-fly multiparty computation on-the-cloud Multikey from Fully Homomorphic Encryption](https://eprint.iacr.org/2013/094) by Lopez-Alt et. al where authors describe a ntru based homomorphic encryption scheme suitable for a multikey context. Multikey means each party encrypts its inpu...
How can I implement decryption for ntru homomorphic encryption scheme?
I understand that in Diffie-Hellman it should be hard to compute $a$ given $g$ and $g^a$. In computational Diffie-Hellam, it appears to be hard to compute $(g^{ab})$ from $g^a$ and $g^b$. Is it also difficult to compute the discrete log of more trivial things, such as $g^a+1$, given $g^a$ and $a$? Or the discret...
AES is a block cipher and would return wrong data when a wrong key is used. It only works on a single block of data (16 bytes). The default CBC mode of operation enables you to encrypt multiple blocks of data. The padding then enables you to encrypt plaintexts of arbitrary length. The padding has to be removed somehow ...
I am trying to use AES as cipher for an application I am building. I am using a JavaScript library (https://code.google.com/p/crypto-js/) to perform encryption and decryption with AES. When I perform decryption, this happens: AES.decrypt(ct, right_key) == 'message decrypted !' //true AES.decrypt(...
Should AES.decrypt(ct, wrong_key) return blank or wrong result?
I understand that in Diffie-Hellman it should be hard to compute $a$ given $g$ and $g^a$. In computational Diffie-Hellman, it appears to be hard to compute $(g^{ab})$ from $g^a$ and $g^b$. As for the field, please consider $\mathbb F_p^*$ for this question. Is it also difficult to compute the discrete log $w$...
In RSA, it is basically equivalent to use the private key $d$ to encrypt as it is to use the public key $e$ to encrypt. They are exactly inverses: $e=d^{-1}$. I need to know, are there other public key schemes like this? E.g., I do not think Diffie-Hellman is like this.
*Perfect Secrecy* (or *information-theoretic secure*) means that the ciphertext conveys no information about the content of the plaintext. In effect this means that, no matter how much ciphertext you have, it does not convey anything about what the plaintext and key were. It can be proved that any such scheme must use ...
You are right that if it costs Alice & Bob effort $N$ to agree on a key in this way, then it costs Eve only effort $N^2$ to find it which is not secure in the standard sense, and probably not very helpful. More generally, this purports to be a key agreement protocol whose only ingredient is a hash function / one-way...
Is there any difference in adding the plain text and key vs using xor instead(apart from the performance improvements)?
XOR or add in one time pads?
Simply put, what does “perfect secrecy” mean?
I have designed a specific client and server program, which sends a file from client to server in 32k chunks. I want to encrypt only part of the data. More specifically: in each 32k chunk passing from client to server I want to encrypt only 500 bytes. This, in a non-continuous way (meaning: partial encryptionhere and ...
You are right that if it costs Alice & Bob effort $N$ to agree on a key in this way, then it costs Eve only effort $N^2$ to find it. So the protocol is not secure in the standard sense, and probably not very useful. (Maybe in some highly constrained situation with very short-lived keys?) More generally, this purport...
I'm trying to contrast key rotation requirements for asymmetric and symmetric ciphers. In the case of symmetric ciphers, we have the results such as the so called "CBC Theorem" (stated on pg. 24 of https://crypto.stanford.edu/~dabo/cs255/lectures/PRP-PRF.pdf) The CBC Theorem states that for a "q - query" CPA attac...
I stumbled upon this code on-line, it seems obvious to me that generating all 2^40 keys in trivial time can always be achieved as can hashing each and everyone of them, using the SHARED Salt that "Eve" could easily see: ### Here we outline: ### Sharing a SINGLE FOURTY BIT secret block, using the birthday pr...
I am working with my project. I use projective coordinates but when i convert to affine coordinates, i can't get it. Anybody can help me? Projective Coordinates (X,Y,Z) to Affine Coordinates (X,Y) : When Z is not 0 the point represented is the point (X/Z, Y/Z) in the Euclidean plane (Affine Coordinates) When Z ...
Non-numeric Diffie-Hellman?
I am working with my project. I use projective coordinates but when I convert to affine coordinates, I can't get it. Can anyone help me? Projective Coordinates $(X,Y,Z)$ to Affine Coordinates $(X,Y)$: - When $Z$ is not $0$ the point represented is the point (X/Z, Y/Z) in the Euclidean plane (Affine Coordinates) ...
Convert projective to affine coordinates in ECC?
I hope this question isn't too similar to one that's already been asked, I also want to point out I know part the answer already, AFAIK: I just want some expert input on this. let's model a hash, that more strictly is a bad **PBKDF**, it's there if it worked, to slow down the cracking of passphrases (relatively shor...
I hope this question isn't too similar to one that's already been asked, I also want to point out I know part the answer already, AFAIK: I just want some expert input on this. let's model a hash, that more strictly is a bad **PBKDF**, it's there if it worked, to slow down the cracking of passphrases (relatively shor...
I hope this question isn't too similar to one that's already been asked. I also want to point out I know part the answer already, AFAIK: I just want some expert input on this. Let's model a hash that more strictly is a bad PBKDF. It would exist – if it worked – to slow down the cracking of passphrases (relatively sh...
I just check all the questions with scrypt tag about that and usually it's said that scrypt is nice in theory and theoretically better than bcrypt and PKDF2, but it's too young to be "completely safe". I understant bcrypt is very old and yet unbroken, but since it uses relatively little amounts of RAM crackers can ...
Scrypt not "old enough" to be safe?
Does the time to evaluate a hash function depend on the function input size?
Reading a book on cryptography by Douglas R. Stinson I've met the following theorem, which is stated without proof (see [here](http://books.google.dk/books?id=Yz55lPEuzckC&pg=PA119&source=gbs_toc_r&cad=4#v=onepage&q&f=false)). Thereby, $\mathcal{F^{X,Y}}$ denotes the set of all functions from $\mathcal{X}$ to $\math...
1.I am still learning eliptic curves. I understand the form of affine coordinates (x,y) such as (5,3). If i want to convert (5,3) to projective coordinates (x,y,z) the form of point shouldn't be (5,3,1) ? It is triplet not point is right? so is the true form from affine to projective (x,y) -> (x/z),(y/z) in Zp => examp...
I have come across this paper [On-the-fly multiparty computation via on-the-cloud Multikey from Fully Homomorphic Encryption](https://eprint.iacr.org/2013/094) by Lopez-Alt et al., where authors describe a NTRU-based homomorphic encryption scheme suitable for a multikey context. Multikey means each party encrypts its...
I have designed a specific client and server program, which sends a file from client to server in 32k chunks. I want to encrypt only part of the data. More specifically: in each 32k chunk passing from client to server I want to encrypt only 500 bytes. This, in a non-continuous way (meaning: partial encryptionhere and ...
Cycling hashing in PBKDF's and their limitations in strength?
I hope this question isn't too similar to one that's already been asked. I also want to point out I know part the answer already, AFAIK: I just want some expert input on this. Let's model a hash that more strictly is a bad PBKDF. It would exist – if it worked – to slow down the cracking of passphrases (relatively sh...
I hope this question isn't too similar to one that's already been asked. I also want to point out I know part the answer already, AFAIK: I just want some expert input on this. Let's model a hash that more strictly is a possibly weak PBKDF. It would exist – if it worked – to slow down the cracking of passphrases (rel...
To my understanding, symmetric encryption is where encrypting and decrypting data can occur with the same key. It's possible for symmetric encryption that the encrypting and decrypting algorithms are the same, but this is not always the case. If I'm not mistaken, with AES this could be the case for some block modes,...
Symmetric encryption vulnerable when encrypting and decrypting are the same?
On forums I read DES has 2^56 possible keys so it takes x times to brute force it with hardware x. But there are 64 total bits of which are 8 parity bits. But those parity bits are a `1` or `0`, right? So since you still have to calculate the parity bits and since they arents always the same bit, doesnt this mean th...
Why are there 2^56 possible keys @ DES when there are 64 bits?
The parity bits act as error checking. This question has already been answered. [See similar question here][1] [1]: http://crypto.stackexchange.com/questions/19232/des-encryption-algorithm-all-64-bits-for-key-instead-of-56-bits?rq=1
The parity bits act as error checking. In effect there is only 56 bits being used for entropy. Also This question has already been answered. [See similar question here][1] or [here][2] [1]: http://crypto.stackexchange.com/questions/19232/des-encryption-algorithm-all-64-bits-for-key-instead-of-56-bits?rq=1 ...
As the other answers already state here, game-based definitions are easier to write proofs for, but simulation-based definitions are often clearer in terms of the security guarantee that you get. The best example of this is IND-CPA (game-based definition) versus semantic security (simulation-based definition). Note tha...
My recommendation will be to use a stream cipher consisting of any block algorithm in CTR mode. You could use block ciphers like AES, or hash functions like SHA-3. Stream ciphers are very efficient and light weight, hence it is the preferred cipher for encrypting phone calls. It should be good enough for your projec...
On forums I read DES has $2^{56}$ possible keys so it takes x times to brute force it with hardware x. But there are 64 total bits of which are 8 parity bits. But those parity bits are a `1` or `0`, right? So since you still have to calculate the parity bits and since they aren't always the same bit, doesn't this me...
Why are there $2^{56}$ possible DES keys when there are 64 key bits?
I am developing an application that is going to use AES encryption. Since it is going to use a different key for every message encrypted... - Would it be secure to use a constant IV? (i.e null bytes) - Would it be secure to **not** pad the encrypted message?
If you use an AES key just once, do you need to use IV, and/or pad the message?
Suppose $H$ is a hash function; why is $H(k||H(k||m))$ not secure? See this [HMAC definition][1]. In there, indeed two keys are used and the mac algorithm is $H(k_1 ||H(k_2 ||m))$ . Why don't we use $H(k||H(k||m))$, which has only one key? [1]: http://en.wikipedia.org/wiki/Hash-based_message_authentication_co...
Why does HMAC use two different keys?
What are the benefits and disadvantages of CBC vs. CTR mode? Which one is more secure?
I hope this question isn't too similar to one that's already been asked. I also want to point out I know part the answer already, AFAIK: I just want some expert input on this. Let's model a hash that more strictly is a possibly weak PBKDF. It would exist – if it worked – to slow down the cracking of passphrases (rel...
For symmetric key systems does perfect secrecy imply that all ciphers in the cipher space are equiprobable? I would think not, but I am finding it hard to come up with a counter example Thanks
For symmetric key systems does perfect secrecy imply that all ciphers in the cipher space are equiprobable? I would think not, but I am finding it hard to come up with a counter example.
> **Is javascript RSA signing safe?** …is safe or can people forge… In contrast to the accepted answer, I would **not** call it “safe” from a cryptographic point of view and I would definitely **not** say that *“[ if you take good care of securing your environment where you run the JS code you will be OK. ](http:...
> **Is javascript RSA signing safe?** …is safe or can people forge… In contrast to the accepted answer, I would **not** call it “safe” from a cryptographic point of view and I would definitely **not** say that *“[ if you take good care of securing your environment where you run the JS code you will be OK. ](http:...
Given the affine form of coordinates $(x,y)$ such as $(5,3)$, if I want to convert $(5,3)$ to projective coordinates $(x,y,z)$, should the form of point be $(5,3,1)$? It is triplet not a point, right? So, is the true form from affine to projective $(x,y) \rightarrow (x/z),(y/z) \in Z_p$. For example: $(5,3) \righta...
I'm using Wikipedia and Handbook of Applied Cryptography as references. I know that ESSIV generates an initialization vector (IV) by combining a hashed key with the sector number. However, I only see an IV in CBC, PCBC, CFB, and OFB modes of operation e.g. chained modes. CTR and ECB are **not** chained modes, so whe...
How does CTR-ESSIV work?
I have come across this paper [On-the-fly multiparty computation via on-the-cloud Multikey from Fully Homomorphic Encryption](https://eprint.iacr.org/2013/094) by Lopez-Alt et al., where authors describe a NTRU-based homomorphic encryption scheme suitable for a multikey context. Multikey means each party encrypts its...
How can I implement decryption for NTRU homomorphic encryption scheme?
> **Is javascript RSA signing safe?** …is safe or can people forge… In contrast to the accepted answer, I would **not** call it “safe” from a cryptographic point of view and I would definitely **not** say that *“[ if you take good care of securing your environment where you run the JS code you will be OK. ](http:...
> **Is javascript RSA signing safe?** …is safe or can people forge… In contrast to the accepted answer, I would **not** call it “safe” from a cryptographic point of view and I would definitely **not** say that *“[ if you take good care of securing your environment where you run the JS code you will be OK. ](http:...
> **Is javascript RSA signing safe?** …is safe or can people forge… In contrast to the accepted answer, I would **not** call it “safe” from a cryptographic point of view and I would definitely **not** say that *“[ if you take good care of securing your environment where you run the JS code you will be OK. ](http:...
Say I have four files. Two are completely unencrypted, while the other two are the exact same files other than that they have been encrypted with (apparently) the same public key (via a ransomware virus). Is it possible to deduce the key from these files, so I can apply it to other files also encrypted with the same ke...
Say I have four files. Two are completely unencrypted, while the other two are the exact same files other than that they have been encrypted with (apparently) the same public key (via a ransomware virus). Is it possible to deduce the key from these files, so I can apply it to other files also encrypted with the same ke...
Suppose that **Alice** received the cipher values: $E(x_1), E(x_2), ..., E(x_n)$ that are encrypted using Paillier cryptosystem by $n$ entities with **Bob**'s public key. Alice computes $E(\sum x_i)$ from the product of the cipher values she received. Alice sends $E(\sum x_i)$ to Bob for decryption, but she needs ...
In many Attribute Based Encryption papers I see this line... **The advantage of an adversary A in this game is defined as Pr[b' = b] − 1/2.** Can someone explain what it means to me? I assume it means that the chances of the guess being correct is equal to 1/2. Is this assumption accurate?
What does this advantage statement signify?
Suppose that **Alice** received the cipher values: $E(x_1), E(x_2), ..., E(x_n)$ that are encrypted using Paillier cryptosystem by $n$ entities with **Bob**'s public key. Alice computes $E(\sum x_i)$ from the product of the cipher values she received. Alice sends $E(\sum x_i)$ to Bob for decryption, but she needs ...
I want to compute a multiplication between many secret values and then distribute the result to everyone involved. For this, I thought about an MPC protocol built from Threshold Homomorphic Elgamal. All I need is : - to protect parties secret values - to compute the product homomorphically and obtain the result e...
An MPC protocol from Elgamal is a good solution a homomorphic multiplication?
Are there any successful preimage attacks on any serious cryptographic hash algorithm or at least on serious-looking non-cryptographic hashes (like MurmurHash)?
Are there any successful preimage attacks?
I am looking for a "partial" enryption/decryption algorithm. Let's say I am encrypting the following List of Longs **[1,2,3,4]** (with an private key) to an encrypted value **E**, I would like to produce several keys **K1..n**, which can decrypt just **a subset (some numbers)** e.g. val raw = [1,2,3,4] ...
One possible explanation is, randomness is not going to hurt you, so might as well use it. Also, if we are hoping to prove impossibility, it only makes the result stronger. One other explanation is if the obfuscators are defined to be deterministic, then to satisfy the strong virtual black-box definition (and the w...
Why are obfuscators generally defined to be probabilistic algorithms, rather than deterministic ones?
One possible explanation is, randomness is not going to hurt you, so might as well use it. Also, if we are hoping to prove impossibility, it only makes the result stronger. One other explanation is if the obfuscators are defined to be deterministic, then to satisfy the strong virtual black-box definition (and the w...
In ChaCha20-Poly1305, I know that reusing a nonce loses confidentiality and integrity for all messages encrypted with the (key, nonce) pair. However, is security affected for messages encrypted with the same key (but different nonces?)
What happens if an IV is reused in ChaCha20-Poly1305?
I am looking for a "partial" enryption/decryption algorithm. Let's say I am encrypting the following List of IDs (long values) **[1,2,3,4]** (with a private key) to an encrypted value **E**, I would like to produce several keys **K1..n**, which can decrypt just **a subset (some numbers)** e.g. val rawIds...
I am looking for a "partial" enryption/decryption algorithm. Let's say I am encrypting the following List of IDs (long values) **[1,2,3,4]** (with a private key) to an encrypted string **e**, I would like to produce several keys **k1..n**, which can decrypt just **a subset (some numbers)** e.g. val rawId...
thanks for taking the time to look at my question. So my assumption here is , let's say i've got two people that are trying to talk in a public channel A and B and they want to preserve their confidentiality and integrity. Which Crypto algorithm will they use? symmetric , or Public key? Also , what type of algorit...
[MD4 is Not One-Way][2]. The attack described in the 2008 paper is a theoretical attack with complexity $2^{102}$, which is better than the brute force complexity of $2^{128}$. In later theoretical results reported [here][3] the complexity dropped to $2^{94.98}$ and [here][4] it dropped even further to $2^{69.4}$ for s...
I am looking for a "partial" enryption/decryption algorithm. Let's say I am encrypting the following List of IDs (long values) **[1,2,3,4]** (with a private key) to an encrypted string **e**, I would like to produce several keys **k1..n**, which can decrypt just **a subset (some IDs)**. e.g. val rawIds = [1...
I am looking for a "partial" enryption/decryption algorithm. Let's say I am encrypting the following List of IDs (long values) **[1,2,3,4]** (with a private key) to an encrypted string **e**, I would like to produce several keys **$k_1,k_2,...,k_n$**, which can decrypt just **a subset (some IDs)**. e.g. v...
Say I have four files. Two are completely unencrypted, while the other two are the exact same files other than that they have been encrypted with (apparently) the same public key (via a ransomware virus). Is it possible to deduce the key from these files, so I can apply it to other files also encrypted with the same ke...
Understanding ransomware – What makes plain-text-attacks or brute-forcing so hard?
> Does the length of the public key imply the length of the private key, or can they be unrelated? Yes. The sizes of public and private keys depend on the cryptosystem. Usually they are related *somehow*, but not necessarily. For example, you can store a short value as a private key, which is then used as a PRNG ...
I am currently reading about the length extension attack on Flickr but not understanding what's going on there. m = SECRET || data || padding and api_signature = md5(m). The server sends data and api_signature to the attacker. The attacker now knows: - h = md5(m) = api_signature - data - length of data (WHY...
I am currently reading about the length extension attack on Flickr but not understanding what's going on there. `m = SECRET || data || padding` and `api_signature = md5(m)`. The server sends `data` and `api_signature` to the attacker. The attacker now knows: - `h = md5(m) = api_signature` - `data` - length ...
> Which Crypto algorithm will they use? That will really depend on the situation. To select the algorithms one should ask himself (at least) the following questions:<br> Which standards do you trust? Which standard do you have to use? What computations can you afford? > Symmetric Key or Public key? It again d...
I've heard that it's possible to split up $GF(2^{128})$ into copies of several smaller fields like $GF(4)$ so as to make the math easier in some cases. How do you do that? I know how it works for groups modulo a composite number using regular arithmetic instead of carryless, such as when using the Chinese Remainder...
How to split up $GF(2^{128})$ into smaller fields?
Let's say I've got two people that are trying to talk in a public channel $A$ and $B$ and they want to preserve their confidentiality and integrity. Which cryptographic algorithm would they want to use? Symmetric, or public key based? Also, what type of algorithm suites best and in what key size? In my understa...
> Which cryptographic algorithm would they want to use? That will really depend on the situation. To select the algorithms one should ask himself (at least) the following questions:<br> Which standards do you trust? Which standard do you have to use? What computations can you afford? > Symmetric, or public key b...
I want to encrypt some data(text/voice/video) but it is essential that the size of the cipher data remains the same as the plain data. Which techniques can I use? How secure are these techniques as compared to the ones which increase the size of the data.
Which cryptography technique does not increase the size of the plain data?
I read [RFC 2945][1] and [5054][2] describing SRP, but there was no mention of registration. How should user registration happen in SRP? Is there a standard or paper describing it? [1]: https://www.ietf.org/rfc/rfc2945.txt [2]: https://www.ietf.org/rfc/rfc5054.txt