Encrypt/Decrypt on different Machines

Topics: Cryptography Application Block
Sep 9, 2007 at 2:50 PM
Hi,

I am new to Microsoft Enterprise Library. I have just used the Cryptography Application Block in my application using RjndaelManaged symmetric Cryptography Provider and successfully encrypted and decrypted the data on same machine.

Now there are to scope types.
1) Local User
2) Local Machine

But I want to encrypt data on one machine and decrypt the same encrypted data on some other machine.

1) Which strong Cryptography Provider should I use for this purpose.?

2) Obviously I must have the same encryption key on other machine to decrypt the data. So how to share that?

Waiting for response anxiously,

Regards,

Ahmad Jalil Qarshi
Sep 10, 2007 at 1:21 PM
Hi Ahmad,

You can find answers to these questions under topics "Scenarios and Goals" (for selecting an algorithm) and "Deploying the Cryptography Application Block" (for key distribution).

Hope this helps,
Fernando
Sep 10, 2007 at 3:39 PM
Thanks Fernando,

However I couldn't find the above mentioned topics. If possible kindly send me link to these topics.

Thanks in anticipation.

Regards,

Ahmad Jalil Qarshi
Sep 10, 2007 at 4:19 PM
Hi,

These are the hyperlinks to the local help files:

Fernando
Sep 12, 2007 at 8:02 AM
Hi,

I have read the above topics and exported the key to another machine successfully.

Now I am facing a problem while encrypting/decrypting. The whole scenario is given below:
1) Encrypt data using RjndaelManaged symmetric Cryptography Provider on "Machine A"
2) Save the Encrypted data to some file say "encrypted.txt"
3) Export Key with which the data was encrypted to another machine say "Machine B"
4) After importing the key successfully to "Machine B" decrypt the data in file "encrypted.txt" on "Machine B"

Application throws an exception. "Padding is invalid and cannot be removed".

Kindly help me to solve this problem.

Regards,

Ahmad Jalil Qarshi
Sep 12, 2007 at 12:47 PM
Hi,

Does it work if you try to decrypt the data file on "Machine A"?

Fernando
Sep 12, 2007 at 1:01 PM
Dear Fernando,

It works fine if I encrypt and decrypt on same machine. Only problem is encrypting data on one machine and decrypted that encrypted data on some other machine with same Key value.

If you want I can send you the encrypted data and source code.

Regards,

Ahmad Jalil Qarshi
Sep 12, 2007 at 2:07 PM
Hi,

This could be a problem with the migration of keys. I just tried encrypting and decrypting using different keys and got the same error message about padding.
Try manually entering the same key on both machines to determine if this is the case (and then switch to a safe key).

Regards,
Fernando
Sep 12, 2007 at 3:25 PM
Thanks Fernando,

I have exported they key on other machine again and it solved the problem.

Thanks again and best regards,

Ahmad Jalil Qarshi
Oct 8, 2010 at 8:11 AM

The above link dont  work

can any one help me

Oct 8, 2010 at 8:34 AM

I have replied to your other thread.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com