0
$\begingroup$

I want to combine RSA and ECC. First of all, a particular file is encrypted with the RSA algorithm and then that encrypted data is again encrypted with ECC algorithm.

However, can I use RSA to encrypt and ECC to sign, or do I have it backwards?

$\endgroup$
  • 1
    $\begingroup$ Typically you don't use asymmetric cryptography for bulk encryption. You typically encrypt a symmetric key with asymmetric cryptography, then encrypt the file with the symmetric key, using something like AES. $\endgroup$ – mikeazo May 27 '17 at 2:42
2
$\begingroup$

Both RSA and ECC can be used to encrypt/decrypt or sign/verify data. Neither is efficient when it comes to doing either (for larger amounts of data). That's why in general a symmetric cipher such as AES (in a specific mode) is used to encrypt/decrypt the bulk of the data. A secure hash such as SHA-512 is used to perform a one-way compression when doing a sign / verify method. A combined asymmetric algorithm and symmetric algorithm is called a hybrid cryptosystem.

The most common/recent methods would be to use RSA-OAEP and AES-GCM for encryption and RSA-PSS with SHA-512 for signing. For ECC you can do EC-IES with AES-GCM for encryption and ECDSA with SHA-512 for signing. These can be mixed any way you want. Other variants are possible of course.

Generally you would sign the message first and then encrypt it. Otherwise somebody could strip the signature from the file and sign it himself. You will need a minimum of two key pairs of course, one for the sender and one of the receiver. The AES keys should be generated specifically for encrypting the single message.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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