instruction
stringlengths
15
30k
byte length and offset for k3d3/ed25519 byte[] variables?
Can curve25519 keys be used with ed25519? I'd prefer to use ed25519, but there isn't a fast java version. For my application, I'd like to use curve25519 until I can get a faster ed25519 for java. At the very least can the curve25519 keys be restricted if some can be converted ed25519?
Can curve25519 keys be used with ed25519 keys?
Here is the protocol outline I am looking at (source: [Foundations of Computer Security, Lecture 60: The Needham-Schroeder Protocol][1]) >$$ \begin{array}{ccl} 1.& A \to S \colon& A,B,N_a \\ 2.& S \to A \colon& \left\{ N_a,B,K_{ab},\{K_{ab},A\}_{K_{bs}} \right\}_{K_{as}} \\ 3.& A \to B \colon& ...
I believe you're describing a system where a client, via an API, submits the bcrypt hash of a password with a per-user salt you provide as part of a challenge. You then directly compare the resulting hash against the hash you store in your database. In that case, my recommendation would be to extract the salt, SHA-2...
I believe you're describing a system where a client, via an API, submits the bcrypt hash of a password with a per-user salt you provide as part of a challenge. You then directly compare the presented hash against the hash you store in your database. In that case, my recommendation would be to extract the salt, SHA-2...
In theory, distinguishing cipher text from random text is considered insecure for any PRP algorithm. Say for example , due to Patarin's proof with about six rounds of Feistel Network , the attacker can distinguish cipher text from random text after about $2^{(n/3)}$ queries to the encryption oracle. where n is input s...
I was reading that a current open problem is if inverting the RSA function is as hard as factoring. Does this mean that, its an open problem whether, if given a subroutine that computes in probabilistic polynomial time (i.e. in BPP) the inverse of the RSA function, then its not actually known if we can factor number...
What does "Inverting the RSA function is as hard as factoring" mean semi-rigorously?
I have been educating myself recently about the SHA-2 hashing algorithm, and in the midst of this pursuit, I've encountered a question: This algorithm uses a set of constant hexadecimal values, derived from the cube root of prime numbers, as a starting point for the process. Because these values can be known to anyo...
It has been said that RSA uses a modulus product of two _prime_ numbers for security reasons. But does RSA even work correctly if we allow _composite_ integers instead? I think that "NO". --- Note to Aria: I have edited your question in an attempt to make it clearer (although there is not enough details to allow...
You are trying to generate your own KBKDF. Instead please consider applying a separate (NIST approved) KBKDF on the output of your PBKDF. You should generate a separete "key" for validation and one (or more) for encryption / MAC purposes from your initial output of your PBKDF. If you do apply a KBKDF for each key /...
I have been educating myself recently about the SHA-2 hashing algorithm, and in the midst of this pursuit, I've encountered a question: This algorithm uses a set of constant hexadecimal values, derived from the cube root of prime numbers, as a starting point for the process. Because these values can be known to anyo...
It's best practice to use the KBKDF to generate separate key material for validation as well as for generating the key used for encryption using a different input or counter of each key. If you do apply a KBKDF for each key / IV (using different ID's/counters for each) then you should not have any concern leaking an...
It's best practice to use the KBKDF to generate separate key material for validation as well as for generating the key used for encryption using a different input or counter of each key. If you do apply a KBKDF for each key / IV (using different ID's/counters for each) then you should not have any concern leaking an...
> Would it not be better to use a set of less predictable values? Actually, there aren't any "unpredictable values". SHA-2 is a hash function (actually, it's a family of 6 hash functions; we'll ignore that point for now); a hash function is designed so that anyone can compute it. One use of a hash function is ...
In theory, distinguishing cipher text from random text is considered insecure for any PRP algorithm. Say for example - due to Patarin's proof with about six rounds of Feistel Network - the attacker can distinguish cipher text from random text after about $2^{(n/3)}$ queries to the encryption oracle, where $n$ is input...
Impact of distinguishing between random text and cipher text?
In theory, distinguishing cipher text from random text is considered insecure for any PRP algorithm. Say for example - due to [Patarin's proof]() with about six rounds of Feistel Network - the attacker can distinguish cipher text from random text after about $2^{(n/3)}$ queries to the encryption oracle, where $n$ is i...
Impact of distinguishing between random text and cipher text?
I understand the basic Shamir Secret Sharing protocol, and when two shares are multiplied, the degree of the polynomial increases. I've seen in a number of papers a reference to a degree reduction protocol that can be performed to securely reduce the degree back to the original $t$. Yet I cannot find this construction ...
It has been said that RSA uses a modulus product of two _prime_ numbers for security reasons. But does RSA even work correctly if we allow _composite_ integers instead? I think that "NO". --- Note to Aria: I ([fgrieu][1]) have edited your question in an attempt to make it clearer (although there is not enough de...
I read the summary of deniable encryption on wikipedia:<br> https://en.wikipedia.org/wiki/Deniable_encryption Then I read a question, by `doom123` on security.SE:<br> https://security.stackexchange.com/questions/34684/truly-deniable-encryption But I had a subtly different problem which can be stated as follows:...
Say players use Shamir's secret sharing to share a value $k$ such that each player now holds $k_i$, a share of $k$. How can they securely compute $k \bmod m$ for some $m$. Of course they can interpolate to get $k$ and then reduce it $\bmod \hspace{2pt} m$. But how can they perform some operation on their shares to ...
It has been said that RSA uses a modulus product of two _prime_ numbers for security reasons. But does RSA even work correctly if we allow _composite_ integers instead? I think that "NO". --- Note to Aria: I ([fgrieu][1]) have edited your question in an attempt to make it clearer (although there is not enough de...
What does "Inverting the RSA function is as hard as factoring" mean (a rigorous explanation or intuitive will do)?
Given that some signature schemes (for instance Elgamal) use an ephemeral key that cannot be reused ever. How do people usually protect against this? I'll elaborate more: if you reuse the ephemeral key in Elgamal for two different signatures you have (AFAIK) effectively given away your secret key. If the same public...
How to protect against ephemeral key reuse in some signature schemes?
Would you say: _the probability of mass life extinction on earth caused by asteroid impact is $2^{-28}$/year; but the risk is so big that I think it's worth taking some countermeasure?_ The applied cryptographer's position is that below a certain probability, like $2^{-40}$ lower than mass life extinction on earth, ...
Would you say: _the probability of mass life extinction on earth caused by asteroid impact is like $2^{-28}$/year; but the risk is so big that I think it's worth taking some countermeasure?_ The applied cryptographer's position is that below a certain probability, like $2^{-40}$ lower than mass life extinction on ea...
Given that some signature schemes (for instance Elgamal) use an ephemeral key that cannot be reused ever. How do people usually protect against this? I'll elaborate more: if you reuse the ephemeral key in Elgamal for two different signatures you have (AFAIK) effectively given away your secret key. If the same public...
It has been said that RSA uses a modulus product of two _prime_ numbers for security reasons. But does RSA even work correctly if we allow _composite_ integers instead? I think that the answer is "NO". Define “work correctly” as: - allows encryption and decryption to be carried out as in normal RSA, yielding t...
Let $C$ be a code over the finite field $GF(2)$ with generator matrix $G$ and parity matrix $H$. Let $e+C=C'$ be a coset of code $C$. Let $S$ be a non-singular matrix and $H'=H\times S$. Finally, let $C''\subset C'$. Is there any efficient way of finding any other element of the coset $C'$ by **only** using $C''$ and $...
> I need to encrypt an ASCII string [a-zA-Z0-9:] to an ASCII [a-zA-Z0-9] > string of the same length. The [pigeonhole principle][1] can be used to explain why it is not possible to encrypt every 15-character string from some set of sixty-three characters into an encrypted 15-character string from a set of sixty-t...
Here is it: > Symmetric encryption is no longer necessary, because all security services can be implemented with public-key cryptography. Moreover, in public key cryptography the operations for authentication and confidentiality are exactly the same. Is this true? Why?
Symmetric encryption is no longer necessary?
If someone gives me their PGP key, can I use it with GPG, and vice versa, all the time (100% interchangeable)? Or are there times when they are not compatible, when only PGP can be used with a PGP key, and only GPG used with a GPG key?
If PGP and GPG both follow the OpenPGP standard, are they 100% compatible in all use cases?
No. Did you do any research before asking? I mean, the [GNUPG FAQ](http://www.gnupg.org/faq/GnuPG-FAQ.html) answers this question already... > **Is GnuPG compatible with PGP?** > In general, yes. GnuPG and newer PGP releases should be implementing the OpenPGP standard. But there are some interoperability p...
No. Did you do any research before asking? I mean, the [GNUPG FAQ](http://www.gnupg.org/faq/GnuPG-FAQ.html) answers this question already... > **Is GnuPG compatible with PGP?** > In general, yes. GnuPG and newer PGP releases should be implementing the OpenPGP standard. But there are some interoperability p...
No, they are not 100% compatible in **all** use cases - because it depends on the PGP version. Did you do any research before asking? I mean, the [GNUPG FAQ](http://www.gnupg.org/faq/GnuPG-FAQ.html) answers this question already... > **Is GnuPG compatible with PGP?** > In general, yes. GnuPG and newer PGP rele...
If PGP and GPG both follow the OpenPGP standard, are they 100% compatible in all use cases? No, they are not 100% compatible in **all** use cases, because - depending on the PGP version - there are known interoperability problems. Did you do any research before asking? I mean, the [GNUPG FAQ](http://www.gnupg...
I got this question in a local hacking event, but I couldn't solve it. . Problem Statement ---- Continuing their snooping habit, NSA kept bugging Alice's communication. Resorting to the age old RSA encryption, Alice used 128-bit RSA encryption to exchange messages. Alice shares her public key as $0xffffffa9525...
I got this question in a local hacking event, but I couldn't solve it. . Problem Statement ---- Continuing their snooping habit, NSA kept bugging Alice's communication. Resorting to the age old RSA encryption, Alice used 128-bit RSA encryption to exchange messages. Alice shares her public key as `0xffffffa9525...
I got this question in a local hacking event, but I couldn't solve it. > Problem Statement ---- > Continuing their snooping habit, NSA kept bugging Alice's communication. Resorting to the age old RSA encryption, Alice used 128-bit RSA encryption to exchange messages. Alice shares her public key as `0xffffffa95256...
How can I find the prime numbers used in RSA?
I got this question in a local hacking event, but I couldn't solve it. > Problem Statement ---- > Continuing their snooping habit, NSA kept bugging Alice's communication. Resorting to the age old RSA encryption, Alice used 128-bit RSA encryption to exchange messages. Alice shares her public key as `0xffffffa95256...
> Symmetric encryption is no longer necessary, because all security services can be implemented with public-key cryptography. That's a strong claim which, in it's current state, lacks references and - even more important - proof. Fact is that it could theoretically be done, but practically there are explicit positi...
I am trying find a transfer method for this problem. Suppose Alice and Bob both has access to a function F with two parameters. Func(x,y) randomly returns "p" to alice and "q" to Bob such that x*y=p xor q. Now as per rules of Oblivious Transfer, Alice has s0 and s1 and Bob has c. Bob wants to learn Sc. The catch is al...
Cryptography: Oblivious Transfer with at most one transfer?
Can one cryptanalyze a hashing compression function in the secret key model? in other words, can we assume that we are allowed to query the *compression function oracle* (not the hash) to collect a set of outputs and then recover the chaining value used by the oracle? (we do not consider it in a certain protocol)?
Secret key model for a compression function cryptanalysis?
I'm designing a simple one-time-password mechanism for authentication against a possibly-insecure server - i.e. I don't want to use symmetric shared secrets. The first idea that came into mind was using a hash-chain with a cryptographic hash function, where each device has a random $\text{key}$ and broadcasts $H^n...
A fast non-cryptographic hash function that is "strong enough"?
<h2> Diffie Hellman </h2> [Diffie Hellman](http://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange) is a key exchange protocol. It is an **interactive** protocol with the aim that two parties can compute a common secret which can then be used to derive a secret key used for some symmetric encryption scheme. I t...
For some key schedule $e_n(e_{n-1}(k))$ (where $e_{n-1}(k)$ is the result of the previous round) , does $e$ need to be a one-way function? In the case of DES or Rijndael the key schedule doesn't really look like one, as the adversary only has to reverse the operations to get the input. My question is this: In ...
Hope it will be clear. I need to digitally sign pieces of information. What I'm currently doing is the following (for each piece of information): 1. Run SHA1 on the information 2. Encrypt the result with RSA 3. Store both of them together Now, I can say for sure if someone altered the information. My pr...
I have read that difficulty in breaking many algorithms are based either on Factorization or discrete logarithm. I am reading about schemes that are similar to RSA which make use of integer factorization and Schnorr scheme, which is based on discrete logarithm problem. My idea is to create signature based on any of ...
Factorization or discrete logarithm is difficult for an attacker?
I was reading about Schnorr scheme and in that for signing the signer generates a random number and continues with his operation. I am trying to implement this in a scenario where the signature length is small and the number of possible messages are also very less. Whether generating a random number and signing, fo...
Whether changing the random number selected for each message increase security in Schnorr scheme?
Are the protocols DH-EKE, B-SPEKE, A-EKE, and SRP are considered challenge-response authenticaion mechanisms?
I use the notation introduced in the paper: The parameters of ElGamal are $(G, q, g)$ where $q$ is prime, $G$ is a cyclic group of order $q$ and $g$ is a generator. In the paper, the authors use "exponential ElGamal" such that they have an additive homomorphism, i.e., the message is represented as "exponent" of $g$...
I use the notation introduced in the paper: The parameters of ElGamal are $(G, q, g)$ where $q$ is prime, $G$ is a cyclic group of order $q$ and $g$ is a generator. In the paper, the authors use "exponential ElGamal" such that they have an additive homomorphism, i.e., the message is represented as "exponent" of $g$...
Recetly while studying about cryptographic primtives, I have come across below line in wiki : <http://en.wikipedia.org/wiki/ElGamal_encryption> >Encryption under ElGamal requires two exponentiations; however, these exponentiations are independent of the message and can be computed ahead of time if need be. Does **"...
What does $\Pi$ represents in cryptography?
This is a basic question in cryptography but I have not found a good, comprehensive answer. It is explained that our keys should expire and we should get new, stronger ones with time, reflecting more powerful decryption computing. Does that mean that emails encrypted today will become easier (even trivial) to decryp...
How long will my encryption remain private?
Maybe a silly question, but: I've implemented rabin-miller prime test fuction following Wikipedia and the book Applied Cryptography. Now I'm using it for generating primes with a string seed. The book suggests the following: (1) Generate a random 'n'-bit number (2) Set the high- and low-order bits to 1. (3) ...
I've implemented rabin-miller prime test fuction following Wikipedia and the book Applied Cryptography. Now I'm using it for generating primes with a string seed. The book suggests the following: 1. Generate a random 'n'-bit number 2. Set the high- and low-order bits to 1. 3. Make sure it is not divisible...
I've implemented rabin-miller prime test fuction following Wikipedia and the book Applied Cryptography. Now I'm using it for generating primes with a string seed. The book suggests the following: 1. Generate a random 'n'-bit number 2. Set the high- and low-order bits to 1. 3. Make sure it is not divisible...
The fundamental property of the Rabin-Miller primality test is that, if the value $N$ being tested is composite, then it will return "composite" at least 75% of the time. That is, if we define the function $RabinMiller( N, A )$ that runs the Rabin-Miller test against the number $N$, using $A$ as a witness, then for an...
As Marcin already said, nonces are for replay protection. Imagine an attacker records message 2 and later on manages to comprimise the old key. He could then impersonate $ S $ and make $ A$ and $ B $ reuse the old key by sending the recorded message to $ A $. To prevent this, the nonce is included. $ A $ remembers pr...
If cryptanalyst today were to crack the original Enigma machine, how fast/ how easily could they do it? What methods would they use? The original cracking was significantly helped by operator mistakes, like alway including the same header, always including a weather report, and finally, a long message of "LLLLLLLL.....
How cryptographically secure was the original WW2 Enigma machine, from a modern viewpoint?
Efficiently computing the neutral element in a ring isomorphic to Z/NZ?
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
Is an attacker of an cryptographic algorithm allowed to change order of sub-keys but not changing their number in attack? Would it be called an attack on broken algorithm of chiper?
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
[Whirlpool](http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html) is an interesting little hash function in the Miyaguchi-Preneel family. In my mind, it's most interesting feature is the design of internal cipher W, where the distinction between key and message is dropped, providing a symmetric symmetric cipher. This...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
[Whirlpool](http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html) is an interesting little hash function in the Miyaguchi-Preneel family. In my mind, it's most interesting feature is the design of internal cipher W, where the distinction between key and message is dropped, providing a symmetric symmetric cipher. This...
If cryptanalysts today were to crack the original Enigma machine, how fast/ how easily could they do it? What methods would they use? The original cracking was significantly helped by operator mistakes, like always including the same header, always including a weather report, and finally, a long message of "LLLLLLLL...
Is an attacker of an cryptographic algorithm allowed to change order of sub-keys but not changing their number in attack? Would it be called an attack on broken algorithm of cipher?
In this post on [Cryptome][1] it's noted that a person called Michael Vario is willy-nilly signing people's public key's and uploading those signatures. He is effectively forging a web of trust. I'm sure this kind of thing has been done before. It occurred to me that if the public key servers could be asked to retur...
Would requiring reciprocal signatures create a stronger Web of Trust?
I have a program (a game) that uses Java's randInt function to get a random 16-bit number. Java's randInt() is an 48-bit seed LCG with the following formula: seed[n+1] = (seed[n] * 0x5DEECE66DL + 0xB) mod ((1 << 48) - 1) And randInt() is implemented in such a way that in the game the random number I receive i...
[Whirlpool](http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html) is an interesting little hash function in the Miyaguchi-Preneel family. In my mind, it's most interesting feature is the design of internal cipher W, where the distinction between key and message is dropped, providing a symmetric symmetric cipher. This...
I have a program (a game) that uses Java's randInt function to get a random 16-bit number. Java's *randInt()* is an 48-bit seed LCG with the following formula: seed[n+1] = (seed[n] * 0x5DEECE66DL + 0xB) mod ((1 << 48) - 1) And *randInt()* is implemented in such a way that in the game the random number I r...
> What methods would they use? Since WW2, we know the security of Enigma machines was weakened by the reflector, resulting in two problems: 1. No difference between en- and decryption, which means that if K ↦ T, then T ↦ K. 2. No letter can be encrypted by itself because electricity can not travel the same way b...
I have a program (a game) that uses Java's `randInt` function to get a random 16-bit number. Java's `randInt()` is an 48-bit seed LCG with the following formula: seed[n+1] = (seed[n] * 0x5DEECE66DL + 0xB) mod ((1 << 48) - 1) And `randInt()` is implemented in such a way that in the game the random number I...
I have a program (a game) that uses Java's `nextInt` function with parameter 0x10000 to get a random 16-bit number. Java's `nextInt()` is an 48-bit seed LCG with the following formula: seed[n+1] = (seed[n] * 0x5DEECE66DL + 0xB) mod ((1 << 48) - 1) `nextInt()` is implemented in such a way that the random n...
I am looking at DSA's parameter generation and don't understand why for $p$ a 1024 bit prime is needed if $q$ is chosen as a $160$ bit prime. I thought that the security of DSA relates on the discrete logarithm problem. A good protection against algorithms solving the DLP is to work in a big order subgroup. I would cho...
Why chossing 1024 / 160 bit primes in DSA?
For simplicity I choose two small primes for `p` and `q`. p=3 q=11 n=33 Φ(n)=20 Now we need to find the public key `e`, which has to be coprime with `Φ(n)`. For small numbers like these it is trivial, but how can it be done when larger primes are chosen?