Exception decrypting. Decryption failed. Key not valid for use in specified state.  
Author Message
Pierce Blaylock





PostPosted: Common Language Runtime, Exception decrypting. Decryption failed. Key not valid for use in specified state. Top

Hi, I hope this is the right forum for this issue.

Anyway, I have a VB .NET application that reads/writes an encrypted text file to isolated storage. I am using

GetMachineStoreForApplication() for the isolated storage location and I have run into a problem with an installation on a corporate network with ISA server.

Basically the software is being installed by a system admin using the computers administrator account. The software is activated and during this process the encrypted text file is written to the isolated storage. The user then logs in using their limited access account but when they try to run the application it throws the following exception.

Exception decrypting. Decryption failed. Key not valid for use in specified state.

The exception is thrown by DataProtector.Decrypt(). The DataProtector is created using Store.USE_USER_STORE. Is this incompatible with GetMachineStoreForApplication() in this situation

What would be the likely cause of this error Any help is much appreciated.



.NET Development37