Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DES decryption issue on .NET Core (3.1 and 5.0) since 12.1.0 #151

Closed
GKooijmans opened this issue Mar 17, 2021 · 5 comments
Closed

DES decryption issue on .NET Core (3.1 and 5.0) since 12.1.0 #151

GKooijmans opened this issue Mar 17, 2021 · 5 comments

Comments

@GKooijmans
Copy link

I'm seeing a decryption issue with the DES privacy provider that seems to have been introduced in release 12.1.0
No matter what I try I keep getting Malformed Messages after decryption. If I revert back to 12.0.0 the problem disappears without any additional changes. The Triple DES provider doesn't seem to be affected. Tested this on .NET Core 3.1 and 5.0

@lextm
Copy link
Collaborator

lextm commented Mar 17, 2021

You have to provide more information regarding the issue.

DESPrivacyProvider.IsSupported should return false on .NET Core 3.1/.NET 5, so you cannot use it to decrypt anything. More hints can be found in https://docs.sharpsnmp.com/tutorials/aes.html#providers-on-bouncy-castle

@GKooijmans
Copy link
Author

DESPrivacyProvider.IsSupported has a preprocessor directive that checks the NETSTANDARD2_0 symbol which is not defined when building on .NET 5.0. In which case it always returns true.
The AESPrivacyProviderBase.IsSupported explicitly checks for .NET Core, while the DESPrivacyProvider.IsSupported does not.
I understand you're saying it's not supposed to work on .NET 5, but it does work when using release 12.0.0 of your library (which I enjoy using very much by the way, thank you).

@effun
Copy link

effun commented Jun 8, 2021

You have to provide more information regarding the issue.

DESPrivacyProvider.IsSupported should return false on .NET Core 3.1/.NET 5, so you cannot use it to decrypt anything. More hints can be found in https://docs.sharpsnmp.com/tutorials/aes.html#providers-on-bouncy-castle

After recompile your code on .NET 5 without any change, both DESPrivacyProvider and AesPrivacyProvider work fine. So I guess .NET 5 has everything your project requires. Is it possible to add a framework target for .NET 5 or newer to provide high dotnet version support?

@nothrow
Copy link

nothrow commented Nov 15, 2021

Doesn't this one also fix the issue #146?

Also, please, take note, that this won't work on Windows 7 SP1 (even when net50 is supported there).

@lextm
Copy link
Collaborator

lextm commented Nov 16, 2021

Windows 7 reached end of life a while ago, so no longer in scope for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants