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

System.Security.Cryptography 0xc100000d: #111156

Open
vsfeedback opened this issue Jan 7, 2025 · 4 comments
Open

System.Security.Cryptography 0xc100000d: #111156

vsfeedback opened this issue Jan 7, 2025 · 4 comments
Assignees
Labels
area-System.Security needs-author-action An issue or pull request that requires more info or actions from the author. untriaged New issue has not been triaged by the area owner

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


I installed. net8.0 SDK on the WinServer 2012 system server and ran this code. WPF can execute normally, but there are errors in the console program and webAPI,System.Security.Cryptography unknown error 0xc100000d:
using (RSA rsa = RSA.Create())
{
rsa.FromXmlString(privateKey);
encryptedBytes = Convert.FromBase64String(str);
decryptedBytes = rsa.Decrypt(encryptedBytes, RSAEncryptionPadding.Pkcs1);
result.Data = Encoding.UTF8.GetString(decryptedBytes);
}

I know this is just a simple encrypted string copying format issue, but the error message from debugging forced me to report this problem as it did not provide proper guidance


Original Comments

Feedback Bot on 28/11/2024, 06:32 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 7, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@vcsjones
Copy link
Member

vcsjones commented Jan 7, 2025

I can take a look at this. It very well may be there is an incompatibility with the new RSABCrypt implementation and how it is being used, and Windows Server 2012.

@vcsjones vcsjones self-assigned this Jan 7, 2025
@vcsjones
Copy link
Member

vcsjones commented Jan 7, 2025

I can't reproduce this on Windows Server 2012 using this:

using System;
using System.Security.Cryptography;

RSA rsa = RSA.Create(2048);
byte[] encrypted = rsa.Encrypt([1, 2, 3, 4], RSAEncryptionPadding.Pkcs1);
byte[] decrypted = rsa.Decrypt(encrypted, RSAEncryptionPadding.Pkcs1);
Console.WriteLine(Convert.ToHexString(decrypted));

I know this is just a simple encrypted string copying format issue, but the error message from debugging forced me to report this problem as it did not provide proper guidance

I don't think I understand this comment. Are you saying that you know what the problem is and the error wasn't helpful?

This might be a duplicate of #100414 - this unhelpful error occurs when you use a public key to try and perform a private key operation. This was already fixed for .NET 9.

Can you please put together a fully functional example of the problem you are facing and the expectations of the problem?

@vcsjones vcsjones added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jan 7, 2025
Copy link
Contributor

This issue has been marked needs-author-action and may be missing some important information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Security needs-author-action An issue or pull request that requires more info or actions from the author. untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants