Sign up ×
Information Security Stack Exchange is a question and answer site for information security professionals. It's 100% free, no registration required.

Would having a large number (10^4) of RSA encrypted files make it easier for an attacker to find my private RSA key?

Update: These files would be available to the attacker, and perhaps the content of a few of them could be guessed. The GnuPG implementation with a 2048-bit RSA key would be used, and the public key would be public.

share|improve this question
please clarify the question, what type of RSA are you using, where are these files stored, is your public key readily available, etc? – mrnap Mar 4 '11 at 20:19
@mmap: I updated the question. – user1633 Mar 4 '11 at 20:40

2 Answers 2

up vote 16 down vote accepted

Short answer: there is no issue in encrypting 104 files with the same key.

Longer answer: it is called public encryption for a reason: the public key is, well, public. This means that anybody can encrypt data with the public key (it is the decrypting part which is reserved for the private key owner). In particular, the attacker can encrypt millions of files with your public key, if he wishes so. Asymmetric encryption systems are specifically designed to not suffer from that. In the case of RSA, this implies that any decent RSA encryption protocol includes random padding bytes, as PKCS#1 describes; the protocol used by GnuPG to encrypt data is decent.

share|improve this answer
Thanks. I now realise the obvious answer :) – user1633 Mar 4 '11 at 21:08
+1 -- Didn't have my head screwed on straight when I opened my mouth... – Jeff Ferland Mar 4 '11 at 21:33

No. As long as you're using 2048 RSA and padding, and your public key passphrase is long (I like 20+ characters), uses alphanumerical and special characters, you shouldn't have any problem. Just make sure your private key isn't compromised :)

share|improve this answer
Private key does not equal the password to protect the private key (which you most likely mean). Of course that password has to be good too. The length of the private key is a function of that of the public key (if you only store d, with n, it's about the same size). – Henno Brandsma Mar 4 '11 at 22:01
@Henno Doh! Yep, meant to say "public key passphrase is long", not "private key is long" :) – mrnap Mar 4 '11 at 23:53
what is a "public key passphrase"? Public keys are normally not protected whatsoever. – Fixee Mar 5 '11 at 22:04
@Fixee what I'm trying to say is, when you generate your public/private keys, make sure to choose a suitably long, randomized, and alphanumeric+special char password. Is that clearer? – mrnap Mar 7 '11 at 15:50

Your Answer


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