0

I have a requirement to implement custom RSA encryption-decryption in a peer to peer file sharing system.

I have implemented the peer to peer file sharing system in Java 8 using RMI. Now I need to encrypt the RMI messages using custom RSA without using Java in-built packages for RSA encryption. I referred this to create custom RSA implementation. Now, I need to use this RSA implementation to encrypt/decrypt messages over RMI.

I referred this but it uses a common key to encrypt the message over the network. I could not find any reference using RSA public-private key to encrypt messages over Java RMI.

The requirement is that each node in the peer to peer file sharing system needs to encrypt the messages using their private key and call other node remotely using Java RMI. The receiver will use the sender's public key to decrypt the message. The nodes will have each other's public key beforehand.

It would be really great if anyone can point me in the right direction.

Thanks.

Maverick
  • 1,519
  • 18
  • 32
  • 1
    https://stackoverflow.com/questions/51761721/large-data-not-encrypted-with-rsa-encryption/51767460. Basically: RSA doesn't ecrypt the message, it encrypts a shared key used for symetric encryption of the message. – Juan Apr 15 '20 at 04:51
  • Just pass them around as `SealedObjects`. – user207421 Apr 18 '20 at 03:19

0 Answers0