instruction
stringlengths
15
30k
Given a private RSA key, how do we get the public key?
I assume that $m = pq$ (85) is the modulus, and the number you computed (64) is $\phi(m)$. Now we must choose the exponents ($i$ for public, $j$ for secret? , weird notation) in such a way that $ij = 1$ modulo $\phi(m)$. In fact we can work modulo 16 if we like, because that is the least common multiple of $p-1$ and $q...
I assume that $m = pq$ (85) is the modulus, and the number you computed (64) is $\phi(m)$. Now we must choose the exponents ($i$ for public, $j$ for secret? , weird notation) in such a way that $ij = 1$ modulo $\phi(m)$. In fact we can work modulo 16 if we like, because that is the least common multiple of $p-1$ and $q...
From the [Handbook of Applied Cryptography][1], in discussions of key sharing algorithms, I see definitions: * *Implicit key authentication* is when one party is assured that no other aside from a specifically identified second party has the possibility to determine the secret key (§12.2.1). * *Entity authentic...
This might be a very simple question. However, I am just learning the concept, so just excuse me. I am wondering why there is not any attempt to generate all semiprime numbers? (as an dict. attack to RSA-xxx algorithms). Because as far as I can see, all one is to do is as following: 1) get a database of prime num...
Q1) I've been reading about Poly1305 as implemented in the [NaCl library](http://nacl.cr.yp.to/onetimeauth.html), more specifically I've been referring to this [Java implementation](https://github.com/neilalexander/jnacl/blob/master/crypto/poly1305.java) of NaCl. My understanding of [XSalsa20Poly1305](https://github.c...
Can Poly1305 be used with block ciphers running in CTR mode?
**Part 1** There are some methods to do it. - [Phrack magazine](http://www.phrack.com/issues.html?issue=59&id=15) Get the last four bits from `x`, the last four from `y`, concatenate them, `XOR` them with the last 8 bits that you get from your system timer (or from the fastest timer you have available) - ar...
Is the use of Poly1305 limited to stream ciphers? (note, I'm not talking about [Poly1305-AES](http://en.wikipedia.org/wiki/Poly1305-AES) )? Can it be used with block ciphers running in CTR mode? If so, what other considerations/limitations are there? I like the simplicity of using a single key for encryption/authent...
I've been reading about Poly1305 as implemented in the [NaCl library](http://nacl.cr.yp.to/onetimeauth.html), more specifically I've been referring to this [Java implementation](https://github.com/neilalexander/jnacl/blob/master/crypto/poly1305.java) of NaCl. My understanding of [XSalsa20Poly1305](https://github.com/n...
How does Poly1305 in the NaCl library calculate a MAC?
If you just need to generate random key material, I suggest a simpler solution: use the OS support for generating entropy. On Linux, read from `/dev/urandom`. On Windows, use `CryptGenRandom`. Search to find support on other platforms. If you're doing this in Javascript, read the following: * [Compatibility of...
**Background:** I'm making a program for fun as a learning exercise. I want to generate some *actual random* key material (not pseudorandom) from a Javascript program. For my program is just for encrypting/decrypting plain text letter by letter so I've chosen to use the [ASCII printable character set][1] (what chara...
How to use x and y mouse movement co-ordinates to generate random data in Javascript?
**Background:** I'm making a program for fun as a learning exercise. I want to generate some *actual random* key material (not pseudorandom) from a JavaScript program. For my program is just for encrypting/decrypting plain text letter by letter so I've chosen to use the [ASCII printable character set][1] (what chara...
Algorithm: How to use x and y mouse movement co-ordinates to generate random data?
In the [original paper introducing RSA][1], it is implied that one should first choose $d$ and then calulate $e$ from $p$, $q$, and $d$. However, I have found in other places (such as the [wikipedia article on RSA][2]) that one should first calculate $e$, and only then calclulate $d$ from it. Which of these two meth...
This might be a very simple question. However, I am just learning the concept, so just excuse me. I am wondering why there is not any attempt to generate all semiprime numbers? (as an dict. attack to RSA-xxx algorithms). Because as far as I can see, all one is to do is as following: 1. get a database of prime num...
Why is it impractical to generate a semiprime dictionary?
Until what I have gotten is: A PRG is generator is a part of PRF that produces pseudo-random values for the function. PRF is semantically secure and has no worries of being invertible. Fine, then where is PRP used? What is PRP, where it comes to, how it benefits.
I have a project wherein I have to crack a given cipher text encrypted using RSA and have been given N and e. Can someone suggest an RSA attack using a very small exponent e(here e=3) and no padding?
I can prove when a document was last modified with cryptographic timestamping but is it possible to prove a document was or was not encrypted/decrypted in a given time period? Off the top of my head, I'm thinking maybe some kind of proof-of-work would be needed to encrypt/decrypt a document but I'm not comfortable w...
Is it possible to cryptographically prove when was the last time a ciphertext was decrypted/encrypted?
Salsa20 core is not a collision resistant hash function, see DJB's own webpage: http://cr.yp.to/salsa20.html For example, Salsa20core(x) = Salsa20core(x + c) for c = "0000000800000008...", thus demonstrating trivial collisions. To be concrete, try computing Salsa20core for the the following two inputs: 00...
It's a well-known best practice to not use one key to both encrypt and MAC data. In my application, there are instances where I MAC a piece of data without having encrypted it first. Do I still need a different key than the one used for encryption?
<p> Crypto Stack Exchange is for software developers, mathematicians and others interested in cryptography. </p> <p>Cryptography Stack Exchange is for asking questions about the mathematics and properties of cryptographic systems, their analysis ("cryptanalysis") and subsidiary topics that generally make up crypto...
**Background:** I'm making a program for fun as a learning exercise. I want to generate some *actual random* key material (not pseudorandom) from a JavaScript program. For my program is just for encrypting/decrypting plain text letter by letter so I've chosen to use the [ASCII printable character set][1] (what chara...
You want "a simple chat program that has encryption that is impossible to crack for anyone". This is not a cryptography problem; it is an information security problem. It cannot be solved by cryptography alone. Cryptography might be one tool, but cryptography alone cannot solve this problem. You cannot solve this p...
It's a well-known best practice to not use one key to both encrypt and MAC data. In my application, there are instances where I MAC a piece of data without having encrypted it first. Do I still need a different key than the one used for encryption? Is it OK to use the same key to MAC one piece of data if I'm going to ...
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 was thinking of running AES in CTR-mode and still use the HMAC, but it would be much better to run some sort of stream ...
Recommended authenticated stream cipher for minimum overhead?
Lets say I want to build a simple chat program that has encryption that is impossible to crack for anyone, even a theoretical government with a massive super computer. Ok here's my idea. You'll need to read all the points to get the whole picture I think. - Only two people can communicate with each other with the c...
Lets say I want to build a simple chat program that has encryption that is impossible to crack for anyone, even a theoretical government with a massive super computer. Ok here's my idea. You'll need to read all the points to get the whole picture I think. - Only two people can communicate with each other with the c...
Lets say I want to build a simple chat program that has encryption that is impossible to crack for anyone, even a theoretical government with a massive super computer. Ok here's my idea. You'll need to read all the points to get the whole picture I think. - Only two people can communicate with each other with the c...
Given Merkle-Damgård hash function H, [I know][1] that an attacker can forge a message protected by a MAC *H(secret_key||message)*. Why can't he perform the same extension attack on a MAC construction *H(message||secret_key)*? [1]: http://crypto.stackexchange.com/questions/3978/understanding-a-length-extensio...
Why is H(message||secret_key) not vulnerable to length-extension attack?
I'm currently not sure if I understood how the zero knowledge protocol with vertex-3-coloring works. I'll describe what I think I've understood and I'll write my questions in bold. Zero-knowledge-protocols in general ----------------------------------- **What are they good for? What is a typical scenario?** I...
How do zero knowledge protocol with vertex-3-coloring work?
I am using C and OpenSSL to encrypt files. After experimenting with the OpenSSL command line utility, it makes you enter a passphrase that can be any length, but uses that to create a 256-bit key. How many passwords or keys does aes use & how does it use them? If you can make your passphrase as long or as short as y...
**Zero knowledge in general** > What are they good for? What is a typical scenario? This is an interesting question. One application is authentication: You can choose the secret yourself and not even the server will know it, and it will never be transmitted in any way. You just prove you know the secret again and a...
AES is a block cipher, a cryptographic primitive. It has no involvement with key derivation or anything of that nature. The three standard key sizes are 128 bit, 192 bit, and 256 bit. How you get those keys is beyond the purview of AES, which is concerned *only* with encryption. As I said, it is a cryptographic *primit...
How does the [length extension attack](http://crypto.stackexchange.com/questions/3978/understanding-a-length-extension-attack) against $H(k||m)$ work? ----- For Merkle-Damgard hashes, if you know $H(x)$ but not $m$ you can still choose an $e$ and then compute $H(x||p||e)$ which is a valid authentication tag for $m|...
I have been trying to understand exactly how a length extension attack works on SHA-1. I'll detail below what I've understood so far, so that I can convey my understanding of the same and hopefully get advice on where I'm going wrong. Lets assume that for a message $m$, a secret $s$ is appended to it and the SHA-1 h...
How does the [length extension attack](http://crypto.stackexchange.com/questions/3978/understanding-a-length-extension-attack) against $H(k||m)$ work? ----- For Merkle-Damgård hashes, if you know $H(x)$ but not $x$ you can still choose an $e$ and then compute $H(x||p||e)$. With $x=k||m$ you can compute $H((k||m||p)...
Given a Merkle-Damgård hash function $H$, [I know][1] that an attacker can forge a message protected by a MAC computed as $H(\textrm{secret_key}||\textrm{message})$. Why can't he perform the same extension attack on a MAC construction $H(\textrm{message}||\textrm{secret_key})$? [1]: http://crypto.stackexchang...
I want to provide a service that encrypts and decrypts documents and I want to provide the users with proof that I haven't stolen their secret key and read their documents. I know I can prove when a document was last modified with cryptographic timestamping. Is it possible to prove a document was or was not encrypt...
Updated answer: *No, this is not possible with cryptography.* You have the ciphertext and you have the key. For all anyone knows, you could have made a copy of those to some other computer and decrypted the ciphertext without telling anyone. There's no way (with cryptography) to prove you haven't done that. On...
If Alice wants to talk to Bob and she has to involve a third party system run by Carol to establish, and possibly maintain, communications, then Carol knows that Alice and Bob communicated with each other. Chuck sneaks into Carol's exchange, and now knows that Alice and Bob are talking to each other. Carol decide...
Can cryptography be used to hide routing information from the router?
AES is a block cipher, a cryptographic primitive. It has no involvement with key derivation or anything of that nature. The three standard key sizes are 128 bit, 192 bit, and 256 bit. How you get those keys is beyond the purview of AES, which is concerned *only* with encryption. As I said, it is a cryptographic *primit...
If Alice wants to talk to Bob and she has to involve a third party system run by Carol to establish, and possibly maintain, communications, then Carol knows that Alice and Bob communicated with each other. Chuck sneaks into Carol's exchange, and now knows that Alice and Bob are talking to each other. Carol decide...
Anonymity is indeed hard. How practical does it have to be? There's a trivial solution which is to broadcast everything. That way Carol can make correlations based on the time of messages but otherwise cannot know the destination of each message. The messages can be filtered by the recipient based on an encrypted de...
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 was thinking of running AES in CTR-mode and still use the HMAC, but it would be much better to run some sort of stream ...
I have two questions for Clarification for AE mode choice criteria - GCM : it appears to be actually the most popular and widely used AE mode of operation. however it is also well-known to be highly sensitive (more than other AE modes ?) to IV uniqueness requirement and completely fails if such requirement is not ...
I have an ecryption function E(p) = a*p + b where a=7, b = 10 and the operations are in mod26, and p is the plaintext letter. I was asked to decrypt this cipher LJMKGM using this information. So I tried to solve in this way: 1. I wrote the abcd.. letters and indexed them from 0-25 respectivlly. 2...
how to solve a cipher that was encrypted by encryption function?
how to decrypt a cipher that was encrypted by encryption function?
This is a special case of the [affine cipher](https://en.wikipedia.org/wiki/Affine_cipher) where $m=26$. Let's encrypt a single letter using your $E$. Let it be `m`, say, which is at index 12. So, $$E(12) = (7 \cdot 12 + 10) \mod{26} = 16$$ Now if we try to use the $D$ in your question, we decrypt this as: $$...
I have an encryption function $$E(p) = (ap + b) \mod{26}$$ where the parameters are $a=7$, $b = 10$, and $p$ is the plaintext letter. I was asked to decrypt the ciphertext LJMKGM using this information. So, I tried to solve in this way: 1. I wrote the letters and indexed them from 0 to 25. ...
How do I decrypt ciphertext with this cipher?
It is generally assumed that asymmetric encryption schemes were invented in 1973 at GCHQ in Britain and, independently, in 1976 at the MIT. My question is, if the abstract idea of having a public key and a private key that con only decrypt what has been encrypted with the other, respectively, had been around forty year...
How to build an electro-mechanical public key cipher machine?
Once gcm has been implemented for providing both encryption & authentication solution , it appears obvious to consider that such implementation can also provide (if required by new user) a Mac based authentication only service via using only Gmac instead of complete Gcm. So I wondered if GMAC could or not be propose...
Can GMAC be considered as a valid standalone MAC mode of operation for Authentication only application?
Considering a scenario of anonymous data transfer between seller and buyer using proxies. If we consider that there are three proxies that are being selected by the buyer to obtain data from different sellers (like in emule), how can we make sure that these proxies do not collude with each other to obtain the copy that...
How to implement a hash function(viewed as random oracle) which a string of 0s and 1s to multiplicative group of prime order?
I have questions from <http://link.springer.com/chapter/10.1007%2F3-540-68339-9_1> Suppose we have 2 messages $m_1$ and $m_2$ related by a known relation $m_2=m_1+1$. Suppose further the messages are encrypted under RSA with an exponent of $3$ using a single public modulus $N$. $c_i=m_i^3$ mod$N$, $i=1,2$ Then ...
Has GMAC mode a future outside GCM?
I have to implement a cryptographic protocol which involves a cryptographic hash function $H: \{0,1\}^* \to G$. It is viewed as random oracle. $G$ is a multiplicative group of prime order. I want to know the steps to implement this function. Are there standard functions to do this? The protocols also have pairing...
To answer your question: yes, GMAC does have niche applications where it performs better than either HMAC or CMAC; however it might not make sense for you. First of all, you are correct in that GMAC requires an IV, and bad things happen if a particular IV value is reused; this rather rules out GMAC for some applicat...
When I use SSH to log into a new system, I get asked to verify that the fingerprint (a 32 hex diget string) of the hosts's RSA key is correct. How much if it must I actually compare (by hand/eye) to make it unfeasible for someone to man-in-the-middle me? Assume the adversary has a budget of a few thousand dollars.
How hard is it to generate a partial RSA fingerprint collision?
As far as we know, it is totally infeasible for anyone to create an RSA private key with a public key that has a specific fingerprint. This remains true if you give the adversary a budget of a few billion dollars; the best approach for an adversary would be to try to break in and steal (or purchase) the private key (a...
According to [the Wikipedia page for NSA][1] (emphasis mine): > However, NSA's Fortezza hardware-based encryption cards, created for > the Clipper project, are still used within government, and NSA > ultimately published the design of the SKIPJACK cipher (**but not the > key exchange protocol**) used on the cards...
When I use SSH to log into a new system, I get asked to verify that the fingerprint (a 32 hex digits string) of the hosts's RSA key is correct. How much if it must I actually compare (by hand/eye) to make it unfeasible for someone to man-in-the-middle me? Assume the adversary has a budget of a few thousand dollars. ...
According to [the Wikipedia page for NSA][1] (emphasis mine): > However, NSA's Fortezza hardware-based encryption cards, created for > the Clipper project, are still used within government, and NSA > ultimately published the design of the SKIPJACK cipher (**but not the > key exchange protocol**) used on the cards...
Can two cipher letters per plaintext letter easily defeat character frequency analysis?
As far as we know, it is totally infeasible for anyone to create an RSA private key with a public key that has a specific 32 character fingerprint. This remains true if you give the adversary a budget of a few billion dollars; the best approach for an adversary would be to try to break in and steal (or purchase) the p...
As far as we know, it is totally infeasible for anyone to create an RSA private key with a public key that has a specific 32 character fingerprint. This remains true if you give the adversary a budget of a few billion dollars; the best approach for an adversary would be to try to break in and steal (or purchase) the p...
It is generally assumed that asymmetric encryption schemes were invented in 1973 at GCHQ in Britain and, independently, in 1976 at the MIT. Imagine, if the abstract idea of having a public key and a private key that can only decrypt what has been encrypted with the other, respectively, had been around forty years e...
Since this is an historical question, I am going to digress and make some historical corrections. In science, we give credit for important inventions to the people who published. If it turns out that someone else invented it earlier and didn't publish, they don't get credit. Obviously, they should be mentioned in passi...
Is there a hash function which has no collisions?
Typically when rainbow tables are discussed MD5 hash is used as an example. It's not quite clear whether this attack is specific just to MD5 or to a certain subset of hashes or to just any hash function. Is rainbow table attack applicable to any hash?
Is rainbow table attack applicable to any hash?
Consider a block cipher with a key of size 128 bits but a small block size, say 32 bits, is this kind of block cipher secure ? Thank you.
Is a small size block cipher usable?
What's the difference between One-Way and Cryptographic Hash Function?.
[EAX](http://en.wikipedia.org/wiki/EAX_mode) mode produces an authentication tag [no longer than the length of the underlying cipher's blocksize](http://www.cryptopp.com/wiki/EAX_Mode). So in the case of using [Blowfish](http://en.wikipedia.org/wiki/Blowfish_(cipher)) (a 64-bit block cipher) in EAX mode, the resulting...
Is using EAX mode with a 64-bit block cipher a bad idea?
What's the difference between a one-way function and a cryptographic hash function?
Using [CryptoJS 3.1][1] I noticed that using 3Des, the encrypted message always start with > U2FsdGVkX1 Why is the first part of the encryption always the same? What information does this hold and how does that information become `U2FsdGVkX1`? [1]: http://code.google.com/p/crypto-js/#Encoders
What is U2FsdGVkX1?
The answer is: > Why do the encrypted files always start with "Salted__" ("U2FsdGVkX1" in base64)? Isn't giving away information like this insecure? > The encrypted files must always start with "Salted__" to interoperate with OpenSSL. OpenSSL expects this. The 8 bytes that spell "Salted__" are always immediately ...
You asked [the same question](http://security.stackexchange.com/q/37490/971) over on the IT Security site. Please don't cross-post. It is frowned upon, under the rules these sites operate. Here is what you should be doing: * Truncate the MAC tag to an acceptable length. You will need to choose a length that pr...
This is a followup to a question I asked on stackoverflow, (should have asked here or on Superuser I know). http://stackoverflow.com/questions/17005256/448-bit-blowfish-considering-the-64-bit-blocksize-is-it-secure-at-all-for-larg I got the information CodesInChaos asked for from Crashplan's support. Mode use...
Blowfish in CBC mode with multi-use keys. Is the 64-bit blocksize a fatal issue if one were to encrypt TBs of data?
This is a followup to a question I asked on stackoverflow, (should have asked here or on Superuser I know). http://stackoverflow.com/questions/17005256/448-bit-blowfish-considering-the-64-bit-blocksize-is-it-secure-at-all-for-larg I got the information CodesInChaos asked for from Crashplan's support. Mode use...
This is a followup to a question I asked on stackoverflow, (should have asked here or on Superuser I know). http://stackoverflow.com/questions/17005256/448-bit-blowfish-considering-the-64-bit-blocksize-is-it-secure-at-all-for-larg I got the information CodesInChaos asked for from Crashplan's support. Mode use...
I'm reading about SRP from [this page](http://srp.stanford.edu/ndss.html) and came accross the line that says a party computes > v = g^x I am unfamiliar with reading cryptography texts. Does this mean _g<sup>x</sup>_, or _g ⊕ x_?
Currently busying myself with the Bitcoin "mining" algorithm, I am wondering if the process really cannot be simplified. For reference, the algorithm is basically SHA-256d: $success := SHA256( SHA256( IV || nonce ) ) < target$ The resulting hash of 256 bits is then interpreted as a single number of 256 digits ...