0

I have a question regarding encryption and whether to use symmetric or asymmetric encryption.

The idea is to implement a form of data encryption in a variety of software. This data will be exchanged with third parties, who will verify it. The main objective is to ensure the integrity and authenticity of data. Exchanging keys securely is not an issue.

The question is: Is it best to use RSA (along with a hash function such as SHA-1) or AES encryption to protect the integrity of the data? What are the pros and cons with regards to the following factors:

  • Difficulty of implementation. Is there any difference in how difficult it is for a developer to implement (code) RSA and AES?
  • Computing power. Does RSA or AES require more in terms of computing power and speed in order to encrypt/sign the data?
  • What are good key sizes? 1024 bit RSA / 128 bit AES?
  • Any other factors to should consider when choosing the type of encryption?
  • I implemented both RSA (self-sufficient in encryption) and AES and didn't find essential differences in difficulties of coding. See s13.zetaboards.com/Crypto/topic/7234475/1/ and s13.zetaboards.com/Crpyto/topic/7385224/1/ I personally prefer to employ RSA above 2000 bits and 128 bit AES. – Mok-Kong Shen Jul 25 '16 at 8:10
3

If your main objective is to ensure integrity and authenticity, and not confidentiality, it sounds like what you want is not encryption, but message authentication (symmetric, like HMAC) or a digital signature (asymmetric, like RSA).

Since you mention third parties, it's likely that signing with an asymmetric system should be used, since with a symmetric system the third parties would be aware of the key, and could impersonate the authentic sender (perhaps you).


  • Implementing (coding) RSA or AES even from the ground up isn't difficult per se, but it's difficult to do correctly. Use some well-known library or an application to do it. (For signatures, you could use e.g. GPG.)

  • RSA is (much) costlier to compute in terms of ciphertext bytes than AES, but the usual method is to use RSA to encrypt a symmetric key, and to encrypt the message with that. Or with signatures, to sign a hash of the message (instead of the message by itself).

  • For key sizes, a 128-bit AES key is considered to correspond approximately to a 3072-bit RSA key. 1024 bits for RSA is on the low end.

1
  1. Is is difficult to to implement either? No not really, as long as you use a vetted and verified implemented library.
  2. AES is much faster than RSA, but as you only sign a hash the amount of data operated on should not be much of a concern.
  3. RSA (is that is the assym. alogrithm you wish to use) is 2048 (see) and 256 for AES.
  4. With AES you would probably want to make an HMAC to make the integrity check.

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.