I wanted to create a relay server to which you can safely transfer messages between two peers (for the purpose of nat bypass) for P2P communication. In particular, I referred to the steps in the diagram in this document for exchanging private keys .....
in particular, he says "public key A is encoded with public key B" and vice versa. However, I came across a problem: when I use both keys for 1024 bits, I really got an illegalblocksizeexception when I try to use the public key to encode another.
Reading other questions, some answered that there is a limit on the size of the data that the public can encrypt using RSA. Can I find out if there are any details that I can miss that are omitted from the diagram, or am I doing the wrong thing trying to exchange keys as such ...
source share