Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Sorry for the poor question. Suppose I have a certificate of the following lines:

-----BEGIN CERTIFICATE-----
     //22 Lines of encoded junk
-----END CERTIFICATE-----

And then this base64 encoded key

<key>
MwqzrZVXYvtwYHaPcrmNbSjPverXXi0OxSivw7K1ZVzLOrKPiSvZQmRoYCKUa356Awow1Goo8pkE5B5qL40AwAELm15c2l04246djdgGBspJhyAJX0K0raxZ5KWsb0jGShetPt8y5WKGiXu4YWqH9abbqsAXzeMQiLlV1mY7n3acurlF53oD8t7MYapWsgPtUVTWW7LqGTnnwZLnnPr/QaZ58/DaiDxLuaGhrmW6xbQM94hH4QgnEE23aCgyjyPjQxYZU5bjX0qeOksaB03uw3bX+DkwSB/fbzXrLGz83WS//z/eiz7Smg3HJ+kmuBmU/79S2Tor7ifkevnCH0RMFg==
</key>

Is it possible to get the raw private key, I think something of this nature:

-----BEGIN PRIVATE KEY-----
     //15 lines of encoded junk
-----END PRIVATE KEY-----

How can I get that? I thik this was all done with openssl. Thanks

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

The certificate contains only the public key. By construction, it is not feasible to extract or recompute the private key from the public key.

share|improve this answer
    
Thanks for your response. So from the base64 encoded key, can I not get the private key? –  TerrorKid Nov 10 '12 at 13:13
    
@TerrorKid "it is not feasible to extract or recompute the private key from the public key" –  ewanm89 Nov 10 '12 at 13:41
    
@TerrorKid That's with supercomputers working for a while. –  ewanm89 Nov 10 '12 at 13:42
    
@ewanm89 Ok but what is the base 64 encoded key for? –  TerrorKid Nov 10 '12 at 13:44
    
it's the public key, base64 encoding is to send it as ascii text rather than pure binary so that it can go across any protocol. –  ewanm89 Nov 10 '12 at 13:48
show 3 more comments

Acually it is possible to get the private key from the public key without a supercomputer if the key is less than 256 bits.

You can check this tutorial in French : http://www.parlonssecurite.com/factoriser-cracke-une-cle-rsa/

share|improve this answer
1  
One has to do some major fiddling to get OpenSSL to generate an RSA keypair less than 1024 bits. But yes, if the key is small enough it is insecure welcome to the world of cryptography. –  ewanm89 Nov 10 '12 at 15:27
    
And any certificate authority willing to sign certs with such small keys shouldn't have root certificates in any use. –  ewanm89 Nov 10 '12 at 15:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.