473,789 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DPAPI - decrypt error: Decryption failed. Key not valid for use in specified state.

hi

i am using the following setup:
- .net 1.1
- 2 load-balanced iis servers
- DPAPI machine store.
- C#
- i encrypted the connection string separately, one on each machine.

the error i get is: - Exception decrypting. Decryption failed. Key not
valid for use in specified state. BUT ONLY ON ONE MACHINE???

System.Exceptio n: Exception decrypting. Decryption failed. Key not
valid for use in specified state.

Components.Secu rity.DataProtec tor.Decrypt(Byt e[] cipherText, Byte[]
optionalEntropy )
Components.Data .DBHelper.GetDe cryptedData(Str ing _enctryptedData )
any ideas? please help

thanks
cj

Nov 20 '06 #1
1 8985
Did you export the key from one server to the other so they are both set up
the same? If not, you are using mismatched keys, which will cause an
encryption/decryption error.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** *************** ****
Think outside the box!
*************** *************** *************** ****
"BigLuzer" <bi******@gmail .comwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
hi

i am using the following setup:
- .net 1.1
- 2 load-balanced iis servers
- DPAPI machine store.
- C#
- i encrypted the connection string separately, one on each machine.

the error i get is: - Exception decrypting. Decryption failed. Key not
valid for use in specified state. BUT ONLY ON ONE MACHINE???

System.Exceptio n: Exception decrypting. Decryption failed. Key not
valid for use in specified state.

Components.Secu rity.DataProtec tor.Decrypt(Byt e[] cipherText, Byte[]
optionalEntropy )
Components.Data .DBHelper.GetDe cryptedData(Str ing _enctryptedData )
any ideas? please help

thanks
cj

Nov 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1385
by: james | last post by:
I have crated DPAPI libraries and Serviced component running under a specific user. But when i call this serviced component to encrypt a specific username and password(input values) it gives me different encrpyted values everytime. so when i send this encrypted values for decryption i get an error displayed as "Key not
1
1593
by: Nicholas Then | last post by:
I have just written a COM object which ties into a roaming user profile so that I may use DPAPI on many machines and have the same encryption and decryption. When I install it on 2 of my servers it works great one server can decrypt the other server's data. That tells me that the roaming profile is being used properly. Now if I put the same profile on my development machine (XP SP2) I cannot decrypt data coming from the servers and the...
1
412
by: HardBap | last post by:
I'm following the MSDN Article here: <link> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT08.asp </link> All works fine until I try an decrypt the string. I get this error: <error> Exception: Exception decrypting.Exception decrypting. Decryption
3
5917
by: Sushant Bhatia | last post by:
Hi All, I am trying to do encryption/decryption with RSA. For encryption, I use the public key. For decryption, I use the private key. The idea is to take a 80 byte array and encrypt it and then decrypt that result to get the original 80 byte array. However, when I do the decryption I am getting a "Error occurred while decoding OAEP padding." CryptoGraphicException.
8
8185
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy, just for a simple Encryption and Decryption function. thanks, Gidi.
7
17879
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm able to encrypt and then decrypt data okay as in the following code: // encrypt the data // Encryptor enc = new Encryptor(EncryptionAlgorithm.TripleDes); byte key = Encoding.ASCII.GetBytes("0123456789012345");
0
3373
by: Hannibal111111 | last post by:
I found this code on a site for doing string encryption/decryption. The string will encrypt fine, but I get this error when I try to decrypt. Any idea why? I posted the code below. The error actually points to this line of code in byte decrypt function: cs.FlushFinalBlock(); public static byte encrypt(byte clearData, byte Key, byte IV)
0
2068
by: silviu | last post by:
Hello I'm trying to install Microsoft SQL 2005 Server Express Edition but I'm getting the following error: SQL Server Setup unexpectedly failed... Then it says something about a log file. Here's the contents of that log: Microsoft SQL Server 2005 Setup beginning at Thu Nov 22 22:30:08 2007 Process ID : 3856 e:\6f695192a2be55cedd30e3868397bfd2\setup.exe Version: 2005.90.1399.0 Running: LoadResourcesAction at: 2007/10/22 22:30:8...
1
2500
by: SM | last post by:
Hi, I need your help, the following code is not working, ret = sr.ReadToEnd() throws the message error : Length of the data to decrypt is invalid. Any idea ? thank you public string Decrypting(string Source, string Key) { string ret = ""; try
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9499
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10374
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10127
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8998
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5540
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2898
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.