Asymmetric Cryptography - True or False
Correct me if I'm wrong and please explain why it is correct/incorrect: 1. The public key must be equal or larger than the message to be encrypted. 2. If they are the same length it's more secure than if are not. 3. If I want to send a large message but I can't encrypt it because the length of the public key is 256 bytes and my message is much larger, I should segmentate and split the large message to multiple little messages and encrypt and send them over the network 1 by 1. Thanks.
8/30/2021 7:59:28 PMYahel
2 AnswersNew Answer
The answers all depend on what method/algorithm you are using... 1) Depends on the method, if using RSA key, size 2048 bits, your maximum message would be 256 bytes. This is usually true with assymetric algorithms. 2) If what are the same length (key + cipher?). Again this would depend on the algorithm used but with RSA you would need to tailor the public key size to make these match which would be insecure. Allow RSA to add required padding etc. 4. If you are using RSA 2048 and are limited to 256 bytes. Then either use a larger key or encrypt the data with a symmetric key and then encrypt that key with RSA. Then send the symmetrically encrypted data and the asymmetrically encrypted key. On the other end decrypt the symmetric key with RSA, then decrypt the data with the symmetric key. I wouldn’t split or segment messages. With cryptography it’s best to use known/secure methods.
DavX Thanks, so in conclusion: it's better to have the msg the same length as the public key, and if the msg is to large then use symmetric Cryptography. (Btw, I segmented my packets because they were too big for a usual packet anyways... so I segmented it and encrypted each segment...)