Public Key Encrytpion with Web Services
-
I'm working on a web service which uses public key encryption to transfer files to and from a web server. I've run into an issue that I'm hoping someone can help with. I can download files just fine since I can specify the public key as one of the parameters of the Web method and then decrypt the returned byte array. However I'm not sure how to upload an encrypted file. Since I need the public key of the server to encrypt the file on the client side, I created a web methiod which just returns the server's public key. But when I then encrypt the file on the client side and call another web method to send the byte array, the server's instance of the encryption class has changed and the previously used public key is no longer valid. Any thoughts on a possible solution ?
-
I'm working on a web service which uses public key encryption to transfer files to and from a web server. I've run into an issue that I'm hoping someone can help with. I can download files just fine since I can specify the public key as one of the parameters of the Web method and then decrypt the returned byte array. However I'm not sure how to upload an encrypted file. Since I need the public key of the server to encrypt the file on the client side, I created a web methiod which just returns the server's public key. But when I then encrypt the file on the client side and call another web method to send the byte array, the server's instance of the encryption class has changed and the previously used public key is no longer valid. Any thoughts on a possible solution ?
Don't change the public key, persist it somewhere. If you want to have temporary key then the only thing I can suggest is to create a temporary lookup table which associates the public key with the primary key. If the file hasn't started to be uploading within say a day then delete the key from the lookup table, any subsequent attempts to use that key should be redirected to receive a new key. Of course the simplest solution would be to keep use the same public / private key combination for all transfers, as long as you can store it securly on the server.
Just Google it. Failing that try phoning :bob:
-
Don't change the public key, persist it somewhere. If you want to have temporary key then the only thing I can suggest is to create a temporary lookup table which associates the public key with the primary key. If the file hasn't started to be uploading within say a day then delete the key from the lookup table, any subsequent attempts to use that key should be redirected to receive a new key. Of course the simplest solution would be to keep use the same public / private key combination for all transfers, as long as you can store it securly on the server.
Just Google it. Failing that try phoning :bob:
Hello How did you get Bob in your signature? Also sometimes I see other emoticons on the forums that aren't available on the smiley page of CodeProject like badger or picture of a cup. Where do you find them?:)
Regards:rose: