user2240342
user2240342

Reputation: 93

PCLCrypto 'PInvoke.NTStatusException' STATUS_DATA_ERROR

Exception thrown: 'PInvoke.NTStatusException' in PInvoke.Kernel32.DLL Additional information: NT_STATUS error: STATUS_DATA_ERROR (0xC000003E)

Hi, I keep getting this error every so often when I try to decrypt and I have no idea what it means.

I am using Encoding.Unicode.GetString and Encoding.Unicode.GetBytes to write/read the encrypted string in a file.

The full stacktrace is below:

at PInvoke.Kernel32Extensions.ThrowOnError(NTSTATUS status) at PInvoke.BCrypt.BCryptDecrypt(SafeKeyHandle hKey, Byte[] pbInput, Void*pPaddingInfo, Byte[] pbIV, BCryptEncryptFlags dwFlags) at PCLCrypto.SymmetricCryptographicKey.Decrypt(Byte[] ciphertext, Byte[] iv) at PCLCrypto.CryptographicEngine.Decrypt(ICryptographicKey key, Byte[] data, Byte[] iv) at Myapp.filename.d__13.MoveNext()

Upvotes: 0

Views: 252

Answers (1)

john murray
john murray

Reputation: 49

+2 I'm getting petty much the same issue - I found from another post on Xam forums that I should be using Unicode that solved the last padding error but this then popped ip.

trace = {PInvoke.NTStatusException: NT_STATUS error: STATUS_DATA_ERROR (0xC000003E) at PInvoke.Kernel32Extensions.ThrowOnError(NTSTATUS status) at PInvoke.BCrypt.BCryptDecrypt(SafeKeyHandle hKey, Byte[] pbInput, Void* pPaddingInfo, Byte[] pbIV, BCryptEncryptFlags dwFlags) at PCLCrypto.SymmetricCryptographicKey.Decrypt(Byte[] ciphertext, Byte[] iv) at PCLCrypto.CryptographicEngine.Decrypt(ICryptographicKey key, Byte[] data, Byte[] iv)

FWIW this is on a PCL project and occurs when running UWP on the local machine - haven't yet tried it on Android

I notice your post was less than a month ago - I do hope someone can help PCLcrypto is so straightforward to use otherwise

Upvotes: -1

Related Questions