A new set of Microsoft Go builds is now available for download. This release includes a fix to the Windows CNG crypto backend and no other changes.
Microsoft Release | Upstream Tag |
---|---|
v1.23.1-3 | go1.23.1 release notes |
v1.22.7-3 | go1.22.7 release notes |
A Go project using DES or 3DES (TripleDES) with the Windows CNG crypto backend may be broken by this change:
Go’s DES and 3DES implementations use the ECB chaining mode. Unfortunately, CNG defaults to CBC chaining mode, and we were not overriding that property when instantiating DES and 3DES keys.
This PR fixes this mismatch by honoring Go’s chaining mode together with a new extensive test suite that ensures we don’t regress.
This a breaking change: data longer than the DES or 3DES block size (8 bytes and 24 bytes respectively) encrypted with the CNG backend won’t be decryptable after this fix. Note that the Microsoft Go toolchain has implemented DES and 3DES using the CNG backend since Go 1.22.
To work around this issue, please follow these steps:
- Decrypt the existing encrypted data using a Microsoft Go toolchain that doesn’t contain the fix.
- Encrypt the just-decrypted data using a Microsoft Go toolchain that contains the fix.
To be specific, 1.23.1-2 and 1.22.7-2 don’t contain this fix and can be used for the workaround.
As you may know, DES and 3DES are cryptographically broken, but for compatibility reasons, they are supported by Go and Microsoft Go.
0 comments
Be the first to start the discussion.