-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[release/5.0] Change default FeedbackSize for TripleDES internal implementation #43370
Conversation
In .NET Framework, TripleDESCryptoServiceProvider defaults to a feedback size of 8, and TripleDESCng defaults to a feedback size of 64. The static Create by default would return TripleDESCryptoServiceProvider, thus the TripleDES from Create would have a default feedback size of 8. This changes the default sizes of TripleDES to behave more similarly to .NET Framework to make porting CFB code from Framework easier. The internal 3DES implementation (and thus TripleDESCryptoServiceProvider, since that is a wrapper around the internal implementation) now defaults to a feedback size of 8. TripleDESCng and user-derived classes from TripleDES will continue to use a feedback size of 64.
Servicing approved the change via #43259, since we didn't want the change in 6.0 if we weren't going to do it in 5.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change to this test: CFB8 is not supported in Windows 7, so this test needs to be marked as such.
...ests/System/Security/Cryptography/AlgorithmImplementations/TripleDES/TripleDESCipherTests.cs
Outdated
Show resolved
Hide resolved
…thmImplementations/TripleDES/TripleDESCipherTests.cs Co-authored-by: Kevin Jones <kevin@vcsjones.com>
Committed the test so we can get updated results. |
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @jeffhandley |
Test failures in "System.Numerics.Vectors.Tests" and installer "Can_Run_App_With_StatiHost" appear unrelated. |
@bartonjs you signed off, but I since committed that Win7 change so I'll let you confirm that's correct and merge this yourself.. |
Breaking change doc issue is dotnet/docs#21103. |
Oh, we have a flaw in my bot programming, haha |
Disabled that while I figure it out. |
Backport of #43259 to release/5.0
/cc @bartonjs @vcsjones
Customer Impact
Reported by a customer in #43234.
A new mode of symmetric encryption was added to .NET 5, CFB mode. This mode already exists in .NET Framework. When it was brought to .NET 5, the default
FeedbackSize
for some implementations ofTripleDES
differed from the .NET Framework implementation. Customers that were relying on theFeedbackSize
's default value in .NET Framework may get incompatible encryption results when porting their .NET Framework code to .NET 5. This is difficult to diagnose - the observed behavior is different results when encrypting data in this mode.Testing
The default values for
FeedbackSize
of various algorithms was manually validated against .NET Framework. Unit tests are introduced to solidify the behavior and prevent it from regressing.Risk
Minimal. The default
FeedbackSize
forTripleDESInternalImplementation
was changed from 64 to 8. Since this mode is new in .NET 5, it does not break compatibility with previous versions of .NET Core. It changed the default behavior from previous previews and RCs of .NET 5.