RSA En/Decryption

Public/Private Key Generation

The private and the corresponding public key can be generated


Private and public key can be passed to the factories. However, if you choose a factory method with no public/private key parameter, they will be automatically generated.

Enable RSA En/Decryption

Use the ConnectionFactory to create a secure connection.


There is nothing to consider while using RSA. (No code adjustments either) Establishing a UDP connection with a SecureTcpConnection will automatically create a SecureUdpConnection.

Important Notice

  • RSA connections are slower; compared to normal connections.
  • RSA packets are larger; compared to nromal packets.

Switch current code-base to RSA

Simply replace .CreateClientConnectionContainer with .CreateSecureConnectionContainer and .CreateServerConnectionContainer with .CreateSecureServerConnectionContainer.


  1. Thanks for the feature, but do you use RSA for the whole communication?
    RSA is usually only used for the key exchange and symmetric cryptography is then used for communication. This will enhance performance and could, depending on the algorithm, provide perfect forward secrecy.

    • Currently RSA is used for the whole communication, even thought, a request on GitHub has already been submited for AES support. However, this feature may arrive in the future. Feel free to contribute 🙂

      Thanks for your interest and feedback.

      EDIT: Ticket has been created

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.