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.

I've got a X.509 certificate, created by an unknown CA. The only thing I know is that the private key is very short, so I can retrive the private key. Is there any program I can use? The used algorithm for the signature is SHA1RSA.

share|improve this question

1 Answer 1

The fact that SHA1 was used is trivial; if you have the private key used to encrypt the hash digest, you can make any changes you like, recompute the digest and push it out. You don't necessarily have to break SHA1 if what you're after is the RSA private key.

By "small", how small are we talking? The largest RSA modulus ever factored (thus indicating that that key bitsize can be feasibly cracked) was 768 bits in length (232 decimal digits long), and it used the General Number Field Sieve method that is the current gold standard for RSA cracking. Most certificates have been using 1024-bit keys or better for years now (what's 1KB between friends, especially with broadband Internet?), with the current minimum being 2048 bits (considered impossible with current knowledge of the pace of technology, but possibly vulnerable to a new type of hardware or uncovered vulnerability) and 4096 bits being the gold standard (considered impossible even if a future vulnerability or quantum leap in hardware reduced cracking time complexity by half).

Also, do you know what padding was used? Vanilla RSA, without any padding scheme, is vulnerable to certain mathematical attacks, which is why nobody's used vanilla RSA for a while now; most RSA encryption is performed either with PKCS or with OAEP padding schemes which reversibly obfuscate the plaintext before encryption (making various types of known- or chosen-plaintext attacks much more difficult).

Lastly, if the CA was using such a small key size, the CA certificate that signed the one you have may well be expired (meaning cracking it is a moot point; anything you generate won't be accepted because one or more certificates in the trust chain have expired).

share|improve this answer
    
Well I just have the pulic key indicated in the certificate. The main goal is to obtain teh private key. I guess the key size is smaller than 768. About the padding I really don't know what scheme is used. Actually the certificate is valid until 21/12/2013. –  ice_mint Dec 21 '12 at 19:22
    
Actually, if the quantum leap is quantum computers able to factorise numbers more than a few bits in length, then we have a problem. Currently quantum computers can factorise numbers about 4 bits long. –  ewanm89 Dec 21 '12 at 20:34
    
@ewanm89 - Yes, quantum computers are the looming threat to RSA and most other large-number reverse-math problems. As you say, however, we currently have computers with enough qubits to handle N-values from 1 to 16. Practically speaking, most long RSA key values are quite safe for the foreseeable future. –  KeithS Dec 21 '12 at 20:49
    
Just one more question I've got a digital certificat in .crt extension. I have the public key, the signature, but I don't understand what is the "n" in the RSA signature system. I mean teh modulus. Thanks –  ice_mint Dec 21 '12 at 21:31
    
The modulus, N, is the majority of the "public key" (the exponent used for encryption with the public key is typically small). N is a number that is the product of two large prime numbers. Encryption is performed by turning the message into an integer number less than N, raising that message integer to the power of the exponent, then modulo dividing by N. The resulting number is the ciphertext. The ciphertext is decrypted by raising it to a different exponent, but then dividing by the same modulus to obtain the plaintext. See en.wikipedia.org/wiki/RSA_(algorithm) –  KeithS Dec 21 '12 at 21:41

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.