I need a duel public/private key encryption system that works like this:
First set public/private: Public encrypt, private decrypt.
Second set public/private: Public Decrypt, Private Encrypt
I need to be able to encrypt from php, then decrypt in .NET, and vice versa. So I need Encrypt/Decrypt methods for each public/private key set designed in both [url removed, login to view] and PHP. Maybe throw in a version for C# as well :)
Just to be clear, the private key for both will be server side, but the goal is to have a secure 2 way communication that works something like this:
Application ([url removed, login to view]) encrypts data using public key #1 and transmits it to the server. The server decrypts it with the associated private key. Later, after processing, the server encrypts the same data using private key #2, and the application downloads that data and decrypts it using public key #2. The idea here is to ensure that communication between the server and client is not forged by a 3rd party that has the originating data... even if the data is correct, the encryption would not be, and decryption would fail on the client side.
I am looking for someone who has the code for these already written and wants to re-sell it to another client using a new/different public/private key set (we will likely change the public/private keys anyway). I am a .NET coder and am not comfortable writing this in PHP, which is the reason for this posting.
Now... key size. The larger the better, but we only want to ensure that a hacker/cracker is unable to replicate an encrypted stream even if he has the unencrypted data that is being sent and the public decryption key - we want the encryption private key to be large enough so that he cannot figure it out and duplicate it... am sure one of you crypto experts know much more about that than me :)