Tag Info

Hot answers tagged

10

In general, the public and private keys are computed together. For some schemes, the public key is computed from the private key. ElGamal is an example. (The system parameters include a suitable cyclic group $G$ with a generator $g$. Choose a random exponent $a$. Compute $y=g^a$. The public key is $y$, the private key is $a$.) For other schemes, this is ...


7

Copy / paste that key into http://phpseclib.sourceforge.net/x509/asn1parse.php and you'll see that there are several different integers in there. p is there, q is there as is the exponent and several other integers to speed things up by taking advantage of the Chinese Remainder Theorem. The key is encoded using DER and derives semantic meaning via ASN.1. ...


5

The reason that one must be derived from the other is that the private and corresponding public key are strongly related: For instance, in RSA, the pair satisfies $ed\equiv 1\mod\varphi(n)$; in Diffie-Hellman, we have $A=g^a$; and so forth. Hence, it is just natural to start with with generating one part and deriving the other to satisfy the cryptosystem's ...


5

It is correct that the given private key does not encode a single integer, and that it includes two primes $p$ and $q$. More precisely, that Base64 data encodes a string of bytes, which is an RSAPrivateKey encoded per ASN.1 DER-TLV (and thus BER-TLV) following PKCS#1v2 Appendix A.1.2 (likely restricted to version 0). It decodes to: 30 ASN.1 tag for ...


4

While the way that Robert showed can work if $e$ is small (and if $e \cdot d \equiv 1 \pmod{\phi(n)}$ (which is not necessarily true), there is a slightly more complicated method which will work in any case. What we do is compute $\lambda = (e \cdot d - 1)/ 2^k$ odd (and $k$ is the integer that makes $\lambda$ odd. The special property that $\lambda$ has ...


3

It is logically impossible to transfer a private key. The key will continue to be a signature key, but it will cease to be "private" the minute it is transferred. A signature key that isn't private isn't a private key. If you want the document to be signed by the user (in any semantically coherent sense), this operation has to take place on a device ...


2

Generally the public exponent is small. then if you know the public and private key, then you can compute $e.d=1+k.\phi(n)$. k is smaller than e and $\phi(n)$ is in the range of n. A direct method allow to make an exhaustive search on the small k which divide ed-1 in such a way that $\frac{e.d-1}{k}$ is an integer. Then $\phi(n)= p.q -(p+q)+1$ allow to find ...


1

To find multiplicative inverse (d) mod φ(n) you may use Extended Eculdian Algoritm "EEA"(or any other algorithm but EEA is usually used to best of my knowledge). The algorithm is explained here http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm this online tool computes the inverse using EEA http://www.cs.princeton.edu/~dsri/modular-inversion.html ...


1

(Realised my mistake as I finished typing the question) Finding the multiplicative inverse is in fact computationally feasible. The prime numbers p and q are not public (although n = pq is). An attacker cannot therefore know φ(n), which is required to derive d from e. The strength of the algorithm rests on the difficulty of factoring n (i.e. of finding p ...


1

Usually we only consider those keys, we can actually use. There is no restriction about the bits in a symmetric key, you can use all of them. For asymmetric encryption schemes, both keys need to fulfill some constraints to actually work. For example: In RSA, $e$ has to be chosen coprime to $\phi(n)$, and you need $ed=1 $ mod $\phi(n)$0. What does it mean? ...


1

For public key encryption, there's an easy solution using a variant of Elgamal. (If you want to do authentication, you can use standard algorithms. If you specifically want signature schemes, say so.) Recall that the security of Elgamal is equivalent to DDH, which is talking about indistinguishability of certain subgroups, namely given a cyclic group $G$, a ...


1

The answer is: this question is based on a mistaken premise. The private key is usually not generated first. In general, they're generated at the same time. For some schemes, the public key can be derived from the private key, but this doesn't always hold, and that will depend on specific properties of the particular public-key scheme. If it's possible ...


1

What about the beautiful images on this page, Certificate Binary Posters part 1 and part 2? I'd believe they would be useful in this case.


1

This is a very interesting question, in the sense that every smart card provider claims the inviolability of its own process. Nowadays, Smart cards can generate their cryptographic keys on the card itself using appropriate hardware. Entropy is generally generated by an embedded random generator. The hardware of the generator is generally certified by ...


1

To conclude the answers here's a note about the simplest way (on linux at least) to view the contents of such keys with openssl: $ openssl rsa -in test.key -text Private-Key: (512 bit) modulus: 00:83:8b:7a:98:1d:a9:7a:cc:d3:b3:b8:75:5f:e7: 27:98:12:03:5d:a3:72:30:5e:05:72:b9:99:93:bb: 19:ce:fb:f0:7b:af:84:98:be:46:fa:a1:4a:2f:36: ...


1

A digital signature requires the person/entity doing the signing to be the ONLY one with access to the private key. So by transferring the document AND the key to your server it basically invalidates the whole process as you can now forge the signature of the user. The process works as follows: The private key transforms the original in a unique way. The ...



Only top voted, non community-wiki answers of a minimum length are eligible