Encrypt and decrypt large files with RSA, is it possible? I need to encrypt / decrypt files and save the private key named file encoder I've seen it's not acceptable to work on large files with RSA Is there a way to do this anyway? and if not How to connect AES to RSA and save minimum keys (I can not save the keys in a separate file)

closed as too broad by David, Eric G, Steffen Ullrich, Matthew, Serge Ballesta Jan 12 at 14:43

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hi, welcome to security.SE! Unfortunately, your question is very broad and requires books for a comprehensive answer, therefore not suitable for this site. Your best bet is to use some off-the-shelf solution (there are many encryption libraries available, many open-source or built into a language/framework). – sleske Jan 11 at 13:48
  • I wouldn't say so. In fact, the answer to the first question is easily googleable: this for instance might help crypto.stackexchange.com/questions/41745/… – Tom K. Jan 11 at 18:09

RSA is way too low level for users and most application programmers, never implement an encryption scheme using RSA yourself. There are way too many pitfalls that will render your encryption to become useless when using plain RSA.

Instead, just use something like GnuPG (which uses OpenPGP format):

gpg --output encrypted.gpg --encrypt --recipient avigaga plain.txt

and to decrypt:

gpg --output plain2.txt --decrypt encrypted.gpg

There are also GUI tools for all major operating systems if you do this often and if that's your preference.

OpenPGP uses RSA and AES, but it has combined them in a secure way, so you don't have to combine them yourself, and so you avoid the pitfalls of trying to combine them in insecure ways.

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