instruction
stringlengths
15
30k
> How does Diffie-Hellman prevent a man-in-the-middle attack? Answer: absolutely nothing. If you're using Diffie-Hellman without any sort of authentication, then Oscar can certainly change the keys. When he does that, what's effectively happen is that Alice and Bob aren't actually negotiating keys; Alice is negoti...
I am trying to cryptanalyse multiple cipher–texts that I know are encrypted by different Affine ciphers. I have already analysed the frequency that each character occurs, and compared it to a frequency table of the languages the plain-texts could be in and as a result have a pretty decent idea of what a few characters ...
I know [how Diffie-Hellman Key Exchange works][1]. Is this the main way of encrypting with PGP, ssh, ssl (https), DKIM, ...? I wonder if Diffie-Hellman is the clue to understand **how** encryption with public and private keys work and **why** it works [1]: http://www.math.cornell.edu/~mec/2003-2004/cryptog...
Is encryption mainly using Diffie-Hellman Key Exchange?
> I know how Diffie-Hellman Key Exchange works. Is this the main way of encrypting with PGP, ssh, ssl (https), DKIM, ...? As the name says Diffie-Hellman key exchange is a key exchange protocol, i.e., a protocol where two parties agree on a common secret without having exchanged any secret prior to that, in an inter...
> How does Diffie-Hellman prevent a man-in-the-middle attack? Answer: Diffie-Hellman does not prevent a man-in-the-middle attack. If you're using Diffie-Hellman without any sort of authentication, then Oscar can certainly change the keys. When he does that, what's effectively happen is that Alice and Bob aren't ...
1. Generate a secret random r from Zn*  2. Compute C’ = Cre mod n  3. Submit C’ as a chosen ciphertext and receive back M’ = C’ d mod n = Mr Since C’ = (C mod n) x (re mod n) = (Me mod n) x (re mod n) = (Mr)e mod n  4. Deduce M with a division modulo n since r is known ...
Let $(n,d)$ be an RSA private key and $(n,e)$ the corresponding private key. 1. Generate a secret random $r$ from $(\mathbb{Z}/n\mathbb{Z})^*$ 2. Compute $C’ = C r e \bmod n$ 3. Submit $C’$ as a chosen ciphertext and receive back $M’ = C’ d \bmod n = M r$, since $C’ = (C \bmod n) \times (r e \bm...
Let $(n,d)$ be an RSA private key and $(n,e)$ the corresponding private key. 1. Generate a secret random $r$ from $(\mathbb{Z}/n\mathbb{Z})^*$ 2. Compute $C’ = C (r^e) \bmod n$ 3. Submit $C’$ as a chosen ciphertext and receive back $M’ = C’ ^ d \bmod n = M r$, since $C’ = (C \bmod n) \times (r^e...
I am trying to cryptanalyse multiple cipher–texts that I know are encrypted by different Affine ciphers. I have already analysed the frequency that each character occurs, and compared it to a frequency table of the languages the plain-texts could be in and as a result have a pretty decent idea of what a few characters ...
So I am familiar with attacking implementations of block ciphers via side channel attacks, cache-timing attacks, etc. What implementation attacks are there against hashes or hashed based functions (e.g. MACs, DRBGs, etc.)?
As far as I understand DKIM works like this: - [DKIM][1] is not used to encrypt anything, the only purpose is to mark mails that are not really sent from the claimed domain as **spam**. - the DKIM-enabled **sending server** uses a stored private key to generate a digital signature of the message, which is i...
How does DKIM work?
As far as I understand DKIM works like this: - [DKIM][1] is not used to encrypt anything, the only purpose is to mark mails that are not really sent from the claimed domain as **spam**. - the DKIM-enabled **sending server** uses a stored private key to generate a digital signature of the message, which is ins...
How does the signature checking work in DKIM?
You need the private key (which mainly consists out of two large prime numbers) to create a signature, The public key is not enough to recreate the signature. It is sufficient to verify a signature that you're given, but it is not sufficient to generate new ones (or so we hope; if that's not true, the signature scheme ...
I have two secret keys. One is a secret key generated by OpenSSL (primary secret key). Second key is generated by performing one way hash operation to GPS co ordinates and time parameters (geo secret key). Now I want to combine this two keys to be used for an AES encryption. I have two options. 1. Encrypt twice by u...
Lets assume Eve has a lot of PGP conversation with Alice and records all those messages. Bob is also regularly communicating with PGP with Alice. If Bob doesn't care about not having a signature from Alice, could Eve send any of those recorded messages unchanged but without signature to Bob pretending it came from ...
Can you fake messages from recorded message-history?
When it comes to MAC algorithms one can have many choices. CBC-MAC, CMAC, PMAC etc are some MAC algorithms that rely on block ciphers (ex AES) to generate a MAC. On the other hand HMAC is very popular on the Internet and relies on compression functions (ex SHA-1, MD5). What are the drawbacks of each vs the other an...
If Bob does NOT care to check signatures (as in the question), Eve can send ANY message she wants to Bob pretending to be Alice, including but not limited to messages Eve got from Alice; all Eve needs is Bob's public key (which, as the name implies, is assumed public knowledge thus known to Eve) and straight use of PGP...
If Bob does NOT care to check signatures (as in the question), Eve can send ANY message she wants to Bob pretending to be Alice, including but not limited to messages Eve got from Alice; all Eve needs is Bob's public key (which, as the name implies, is assumed public knowledge thus known to Eve) and straight use of PGP...
When it comes to MAC algorithms one can have many choices. CBC-MAC, CMAC, PMAC etc are some MAC algorithms that rely on block ciphers (ex AES) to generate a MAC. On the other hand HMAC is very popular on the Internet and relies on compression functions (ex SHA-1, MD5). What are the drawbacks of each from a security...
I am interested in the ways the implementation of an RSA key generation implementation can or cannot be subverted in a way that gives the subverter an advantage, but leaves the owner of the key, and the people who interact with the owner, unaware that something is going on. I assume that the owner of the key does not h...
I am interested in the ways the implementation of an RSA key generation implementation can or cannot be subverted so that the subverter an advantage, but the owner of the key, and the people who interact with the owner, are left unaware that something is going on. I assume that the owner of the key does not have the ab...
I am interested in the ways the implementation of an RSA key generation implementation can or cannot be subverted so that the subverter an advantage, but the owner of the key, and the people who interact with the owner, are left unaware that something is going on. I assume that the owner of the key does not have the ab...
Chris's [answer](http://crypto.stackexchange.com/a/18643/706) is great. As it does not address how one would detect #2, I'll take a stab at it. Assume there is some watchdog looking at public keys in your system, trying to detect a problem. They can easily tell if two public keys share a prime by computing gcd. A...
1. If the master key is strong (e.g. random 256-bit key), $c=1$ is fine, or you can use [HKDF](https://tools.ietf.org/html/rfc5869#section-2.3). A high number of iterations is only needed when you derive the key from a password or other low entropy string. 2. If you can store a 4000 element table securely, you could...
I am interested in the ways the implementation of an RSA key generation implementation can or cannot be subverted so that the subverter has an advantage, but the owner of the key, and the people who interact with the owner, are left unaware that something is going on. I assume that the owner of the key does not have th...
One of the advantge of having 64-bits smartphone is: Complex Encryption. Improved Security, 64-Bit can process incredibly large numbers allowing you to better encrypt data against unauthorized access. Is the statement above correct, in particular the term **complex encryption**. I mean how the complexity increaaed w...
How does asymmetric crypto work? For example, if you use PGP in emails, you generate a private key that is known only to you and a public key, which is available to everyone. Is there a simple way to explain, why you need a private key and why no one can decrypt the message with just the public key? I think of...
Why can't you decrypt an encrypted message with just the public key?
I am currently working on an anonymous P2P file sharing application and I am elaborating some already existing solutions. Some of them allegedly provide point-to-point encryption using RSA public/private keys to exchange a symmetric secret key, which is then used to encrypt a stream of data. But I wonder how is it p...
I read about the following ["safe" ECC curves][1] and notably, secp256 and all the NIST curves are marked as "unsafe" when compared to more modern curves. I need a curve for signing or encryption, (or both) but not sure how to choose from the following: * M-221 * E-222 * Curve1174 * Curve25519 * E-382 * M-...
How do the following new (2013) ECC curves compare in security or efficiency?
[NSA's Suite B Cryptography](https://en.wikipedia.org/wiki/NSA_Suite_B_Cryptography) suggests some cryptographic algorithms for encryption, digital signatures, message digests and key agreements. The selected algorithms and their key size are suggested by the security level needed. But is there any reason to think t...
Rely on NSA Suite B Cryptography?
It mainly depends on how the algorithm was selected. If it was selected by a public competition like for AES, then it is *likely* to be secure. If it was forced in by the NSA such as Dual-EC random number generator, then you may have some doubts. Other questions you may want to ask yourself are: - is this an "or...
It mainly depends on how the algorithm was selected. If it was selected by a public competition like for AES, then it is *likely* to be secure. If it was forced in by the NSA such as Dual-EC random number generator, then you may have some doubts. Other questions you may want to ask yourself are: - Is this an "or...
How can one be sure that the man who you're talking with is the one who you think he is? i.e. How <br> can one perform authentication in P2P network without a central trust server or Certificate Authority? I'm just wondering how someone can make distributed (peer-to-peer) overlay <br> network or chat using DHT f...
I'm designing an id obfuscation system. My system includes: 1. Embedded chips, each chip has a unique 32-bit address (id). 2. Server 3. Insecure low-bandwidth unstable one-way channels from the chips to the server. The chips send messages to the server over the insecure channel. The messages are simple "I'm a...
Is my id obfuscation algorithm secure?
*Note: A distributed signature scheme exists for RSA: [Practical Threshold Signatures, Victor Shoup][1]. Is it possible to adapt such scheme for ECC?* A centralized signing machine is vulnerable to attackers -------------------------------------------------------- In the situation where a private key has been ...
The Luby-Rackoff theorem states that if a round function is a secure pseudorandom function (PRF) then 3 rounds are sufficient to make the block cipher a pseudorandom permutation (PRP). PRPs are invertible whereas PRFs are not. How come 3 rounds of a PRF will make an invertible block cipher out of a non-invertible ...
How can one be sure that the man who you're talking with is the one who you think he is? i.e. How can one perform authentication in P2P network without a central trust server or Certificate Authority? I'm just wondering how someone can make distributed (peer-to-peer) overlay network or chat using DHT for finding pee...
> One of the advantage of having 64-bits smartphone is: Complex Encryption. Improved security, 64-Bit can process incredibly large numbers allowing you to better encrypt data against unauthorized access. Is the statement above correct, in particular with regards to the term **complex encryption**? I mean how the com...
I'm designing an id obfuscation system. My system includes: 1. Embedded chips, each chip has a unique 32-bit address (id). 2. Server 3. Insecure low-bandwidth unstable one-way channels from the chips to the server. The chips send messages to the server over the insecure channel. The messages are simple "I'm a...
> One of the advantage of having 64-bits smartphone is: Complex Encryption. Improved security, 64-Bit can process incredibly large numbers allowing you to better encrypt data against unauthorized access. Is the statement above correct, in particular with regards to the term **complex encryption**? I mean how the com...
Braid groups has drawn the attention of cryptographers for a few years, as a promising platform for post-quantum cryptographic protocols. The security of the proposed schemes mostly relied on conjugacy problems, and attacks against this problem were discovered, and cryptographers lost interest in those braid groups. Bu...
I read about AEZ encryption scheme from CAESAR competition.<br> http://www.cs.ucdavis.edu/~rogaway/aez/aez.pdf<br> <br> To me it seem like a construction of arbitrary length block cipher from a smaller one.<br> The key component is the mixing function. (see the figure)<br> ![Mixing](//i.imgur.com/9Ucbo36.png) Lef...
I read about AEZ encryption scheme from CAESAR competition.<br> http://www.cs.ucdavis.edu/~rogaway/aez/aez.pdf<br> <br> To me it seem like a construction of an arbitrary length block cipher from a smaller one.<br> The key component is the mixing function. (see the figure)<br> ![Mixing](//i.imgur.com/9Ucbo36.png) ...
I am working on a concept for a game that in the end will allow data sharing via plain text, but I would like to give the user the option of encrypting the data so that other players cannot modify it, but the program/game will still be able to read the data for use otherwise. My question then would be, is there a meth...
I read about the [AEZ encryption scheme](http://www.cs.ucdavis.edu/~rogaway/aez/aez.pdf) as presented at the CAESAR competition. To me it seems like a construction of an arbitrary length block cipher from a smaller one. The key component is the mixing function. (see the figure) > ![Mixing](//i.imgur.com/9Ucbo36.png)...
I read about the [AEZ encryption scheme](http://www.cs.ucdavis.edu/~rogaway/aez/aez.pdf) as presented at the CAESAR competition. To me it seems like a construction of an arbitrary length block cipher from a smaller one. The key component is the mixing function. (See the figure… Left: without cipher text stealing, Right...
What algorithm could/should be used to encrypt files for storage on untrusted servers?
> **Advantages of having a 64-bit CPU vs 32-Bit CPU smartphone** … 3. **Complex Encryption. Improved Security**: 64-Bit can process incredibly large numbers allowing you to better encrypt data against unauthorized access. <sup>source: http://www.amongtech.com/what-is-the-advantage-of-having-a-64-bit-smartphone...
I want to compare two cryptographic algorithms. The first algorithm is RSA, and second algorithm is ElGamal elliptic curve cryptography. Now, I’m looking for a way to compare the speed of the two algorithms (time needed to complete calculations). Someone told me about computing “time complexity”. Is that really an a...
Is it computationally plausible to use NN/ML to do any of the following tasks? 1. "Real" cryptanalysis. Cyclic neural networks for extended computation, but break the hash all the way through. 2. Estimating the entropy of the plaintext from the ciphertext. 3. Any other cryptanalytic trick or procedure.
I was wondering if there were any security implications of deriving session keys from a symmetric key using SHA256 in the following manner: $Ks = SHA256(Nonce||K)$, where $Nonce$ is the session specific nonce and $K$ is the pre-shared symmetric key. And $Ks$ will be derived at both ends as mentioned. As far as I am ...
Let's say that we have a hardware AES implementation that, on request, will encrypt or decrypt a 16-byte block of data in ECB mode using a fixed key, but refuses to reveal its fixed key. In other words, an oracle. This oracle has a flaw: if you read the hardware's output registers before the device says that its ou...
Quoting part of my homework/assignment: > How many keys are required for secure communication among 1000 person if: > 1. Symmetric key encryption algorithm is used? 2. Asymmetric key encryption algorithm is used? My guess: For symmetric they each need to maintain and transfer their own key, so probably $1...
Number of keys when using symmetric and asymmetric encryption?
I want to write AES from scratch without using the built in libraries of java. I know there are hundreds of AES programs (and websites) out there but I can't seem to find a site that gives me the details I think I would/should need to write my own Java program. I know that AES has S-boxes like DES has. Were would I ...
Where can I get information on how to implement AES?
Simple proof that shows AES is not a uniform permutation on any n-bit string?
Is there a simple proof that shows AES is not a uniform permutation on any $n$-bit string? Since I'm just starting with crypto, I'd like to see a simple yet elegant proof for the said property. Thanks!
Does SHA-1024 cryptographic hash function exist similarly to SHA-512? If not, what's the reason for that? Links: - [SHA-2][1] at Wikipedia [1]: https://en.wikipedia.org/wiki/SHA-2
Does SHA-1024 hash exist?
I have constructed a stream cipher from a secure hash algorithm and a HMAC. Here is a brief description of the algorithm: Let: (Actually Objective-C styled pseudo code) * `[data SHA512Hash]`: SHA-512 hash of `data`, * `[data SHA512HMAC:key]`: SHA-512 HMAC of `data` with `key`, * `[data xor:another]`: bitwise XO...
[NxtCoins.NL reports](http://www.nxtcoins.nl/crypto-review-completed/) that BCT user named Jesse James, also known as DoctorEvil, reviewed the Java implementation and he seems to think it is safe. Quoting his publication: [“Crypto Review of Curve25519.java & Crypto.java”](https://gist.github.com/doctorevil/9521116), la...
# Related to Curve25519 Curve25519 seems to be secure so far. Yet, you have to remind yourself that Dr. Bernstein specified Curve25519 for ***key-exchange***. Meaning: key-generation, transaction signing, and verification are somewhat different beasts – you might want to cross-check on that before jumping toward Cur...
There seems to be some error in my understanding of the concept of rainbow tables, despite going through quite a bit of articles on it. Let me show what I don't seem to agree with. My plain text is 5-digit numeric input. Hash function - MD5 Reducing func - Get the first 5 decimal digits from the cryptotext ...
Rainbow tables, where have I got it wrong?
There seems to be some error in my understanding of the concept of rainbow tables, despite going through quite a bit of articles on it. Let me show what I don't seem to agree with. My plain text is 5-digit numeric input. Hash function - MD5 Reducing func - Get the first 5 decimal digits from the cryptotext ...
I'm implementing SHA-256 in PHP using strings. Where do you truncate in the algorithm? There are a lot of places where there's binary addition happening so the number of bits in $W(i)$ keep increasing. Same case with the compression function. So, where do I truncate the values? When I `var_dump` my array I get th...
OK, here's the node.js module that I wrote based on the swap-or-not algorithm in the papers of the first comment (by Ricky Demer). It requires the [Long][1] module. It supports inputs up to 63 bits (there are plenty of algorithms for 64 bits and above). Inputs and outputs should be Long objects. The $K_i$'s are c...
I'm one of the developers of an application which uses SRP-6 as the authentication mechanism. The authentication part of the code is very old and uses N with only 256 bits (all arithmetic is done in modulo N). After receiving reports of stolen passwords we upgraded to SRP-6a with the size of N 1024 bits. We are stil...
in short I'm learning GUI programming in python and thought it could be interesting to make a small GUI for symmetric encryption. Not being mad/mathematical/experienced (take your pick) enough to try to implement ciphers myself I figured I could create a GUI that just sits on top of an existing program (on Linux). So I...
GPG & Mcrypt - difference?
OK, here's the node.js module that I wrote based on the swap-or-not algorithm in the papers of the first comment (by Ricky Demer). It requires the [Long][1] module. It supports inputs up to 63 bits (there are plenty of algorithms for 64 bits and above). Inputs and outputs should be Long objects. The $K_i$'s are c...
"Would it be possible for an attacker to launch an offline <br> dictionary/brute-force attack on the B public key: ..." That is possible if and only if the attacker can distinguish b's distribution from the uniform distribution on {0,1,2,3,...,N-3,N-2}. $\:$ If so, an attacker could compute verifiers v for candida...
"Would it be possible for an attacker to launch an offline <br> dictionary/brute-force attack on the B public key: ..." That is possible if and only if the attacker can distinguish b's distribution from the uniform distribution on {0,1,2,3,...,N-3,N-2}. $\:$ If so, an attacker could compute verifiers v for candida...
I'm one of the developers of an application which uses SRP-6 as the authentication mechanism. The authentication part of the code is very old and uses N with only 256 bits (all arithmetic is done in modulo N). After receiving reports of stolen passwords we upgraded to SRP-6a with the size of N 1024 bits. We are stil...
There is some Thermodynamic Limitations. A good explanation about Thermodynamic Limitations is by Bruce Schneier in [Applied Cryptography][1]: > One of the consequences of the second law of thermodynamics is that a > certain amount of energy is necessary to represent information. To > record a single bit by changi...
Is there a variant of Carter-Wegman MAC that is fast, parallel and has the property of incremental crypto?
In HOTP authentication, is there a way for the system to detect that the token has been desynchronized? If so how does it know that the OTP was generated from a desynched (but valid) token and is not just a fake/random OTP?
Am I loosing any entropy when using KDFs, such as the ones in [NIST Special Publication 800-108][1]? For example, can I derive 128-bit session keys from a (unfiormly random) 128-bit master key? [1]: http://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf
Am I losing any entropy when using KDFs, such as the ones in [NIST Special Publication 800-108][1]? <br> For example, can I derive 128-bit session keys from a (uniformly random) 128-bit master key? [1]: http://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf
"Would it be possible for an attacker to launch an offline <br> dictionary/brute-force attack on the B public key: ..." That is possible if and only if the attacker can distinguish b's distribution from the uniform distribution on {0,1,2,3,...,N-3,N-2}. $\:$ If so, an attacker could compute verifiers v for candida...
below refers to my hobbiest solution using my own cipher program in C#. program and source are free and available. Remember the 'locked box puzzle' recounted on an SECURITY NOW podcast? here's the episode... Episode #33 | 30 Mar 2006 | 43 min. Symmetric Block Ciphers https://www.grc.com/sn/sn-033.txt Steve ...
How do we compute IV+1 in CTR mode?
Remember the “locked box puzzle” recounted on a [*“Security Now!”*](https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCIQFjAA&url=https%3A%2F%2Fwww.grc.com%2Fsecuritynow.htm&ei=0XbzU4DQE-304QTZpIGACA&usg=AFQjCNGcaA21YN7PBbLNvUL5Y4HVRGAosw&sig2=-R3dA9xJOrlxsXEv26ktIA) podcast ([Episode ...
This may sound a little bit of basic but here it goes: Which one is correct- Cryptography is under the security field or Security is under the cryptography field? Cryptography is all about encryption and decryption. Encryption/Decryption requires a key. Isn't security the same? Security also depends o...
This may sound a little bit of basic but here it goes… Which of the following is correct? 1. *“Cryptography is under the security field”*, or 2. *“Security is under the cryptography field?”* Cryptography is all about encryption and decryption. Encryption/Decryption requires a key. Isn't security the same?...
The correct answer would be: > 1 . “Cryptography is under the security field”. It would be even more correct if you would say: **cryptography is the science of information security.** Modern cryptography concerns itself with 4 objectives: 1. **Confidentiality**: the information cannot be understood by anyon...
The correct answer would be: > 1 . “Cryptography is under the security field”. Let me try to explain it a bit… ## Cryptography Modern cryptography concerns itself with 4 objectives: 1. **Confidentiality**: the information cannot be understood by anyone for whom it was unintended. 2. **Integrity**: the i...
The correct answer would be: > 1 . “Cryptography is under the security field”. Let me try to explain it a bit… ## Cryptography Modern cryptography concerns itself with 4 objectives: 1. **Confidentiality**: the information cannot be understood by anyone for whom it was unintended. 2. **Integrity**: the i...
[Annex E.1 of RFC 5246][1] contains the following text which is a nice summary of the situation: > Note: some server implementations are known to implement version negotiation incorrectly. For example, there are buggy TLS 1.0 servers that simply close the connection when the client offers a version newer than TLS 1....
Is there a variant of the Carter-Wegman MAC algorithm that is fast, parallel and has the property of incremental crypto?
Chaocipher was invented by John F. Byrne in 1919. The algorithm was recently revealed – see Moshe Rubin's [_Chaocipher Revealed, the Algorithm_][1] (PDF). While a known plaintext attack successfully finds the keys, nobody has been able to put forward a general solution to this cipher. Is that possible? [1]: h...