In the ElGamal cryptosystem, I was wondering whether the $m$ (message) should be less than $p$ (large prime). Because on decryption, we are getting $m \bmod p$. For $m \bmod p$ to be equal to $m$, shouldn't $m$ be less than $p$? So what should be the size of $p$? Should it be a very very large prime number if I need to encrypt a file of 5 GB or something?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
As your message treated as one element in the finite field defined by $p$, it must be smaller than this $p$.
There are other reasons, but you mention one about why to use hybrid systems. When you encrypt using public key, the process starts by generate a random symmetric key used to encrypt your data. What is encrypted using the public key is this symmetric key.
Another reason is to encrypt to more than one recipient. The data itself is encrypted once for all, and is this symmetric key the one encrypted for each target.
Note that the size of a symmetric key is much smaller than the size of its equivalent in security in public key.
no.. just have only a very large prime $p$, then break your file into chunks less than $p$..
use Cipher Block Chaining (CBC) or Cipher Feedback (CFB) to get the work done.