Skip to content

Add DES CBC decryption for wrapped key imports - #31

Open
keithfong94 wants to merge 3 commits into
masterfrom
codex/3des-cbc-unwrap
Open

keithfong94 wants to merge 3 commits into
masterfrom
codex/3des-cbc-unwrap

Conversation

@keithfong94

@keithfong94 keithfong94 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Context

Add Cipher.DecryptCBC for DES/3DES with an explicit IV, input validation, and no padding removal. This supports G+D PRK imports without changing existing ECB operations or KCV calculations. Prepare version 1.15.0.

Checked double- and triple-length 3DES against independent Python cryptography/OpenSSL vectors with zero and nonzero IVs. Full tests and go vet pass. Fixtures contain synthetic keys only.

Checklist

@keithfong94 keithfong94 self-assigned this Sep 18, 2026
@keithfong94 keithfong94 added the change:standard Not an emergency or impactful change label Sep 18, 2026
@keithfong94
keithfong94 marked this pull request as ready for review September 18, 2026 08:44
@keithfong94
keithfong94 requested a review from a team as a code owner September 18, 2026 08:44
Copilot AI lite review requested due to automatic review settings September 18, 2026 08:44
@keithfong94

Copy link
Copy Markdown
Contributor Author

/request-review

@platon-github-app-production

Copy link
Copy Markdown

Success 🎉 The review request was sent to the following:

If you see something that doesn't look right, follow this doc to improve our slack channel mapping. Thank you!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add single-DES CBC coverage and the standard Apache 2.0 headers.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds explicit-IV, unpadded CBC decryption for DES and 3DES, with documentation and version updates.

Changes:

  • Implements DecryptCBC with input validation.
  • Adds CBC vectors and invalid-input tests.
  • Updates README and version to 1.15.0.
File summaries
File Summary
VERSION.txt Bumps version to 1.15.0.
README.md Documents DES CBC support.
des/des_cbc_cipher.go Adds CBC decryption implementation.
des/des_cbc_cipher_test.go Adds CBC vectors and validation tests.
Review details

Suppressed comments (1)

des/des_cbc_cipher.go:10

  • The new API is documented as supporting both DES and 3DES, but the tests only construct a 3DES cipher. A regression affecting CreateFromDESKeyBytes/CreateFromDESKeyString would therefore leave the newly supported single-DES CBC path unverified; add at least one independent single-DES CBC vector (the invalid-input cases can be shared).
func (c *Cipher) DecryptCBC(cipherBytes, iv []byte) ([]byte, error) {
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread des/des_cbc_cipher.go
Comment thread des/des_cbc_cipher_test.go
keithfong94 and others added 2 commits September 18, 2026 16:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@wise-github-bot-app

Copy link
Copy Markdown

The approval(s) from conanak99 do(es)n't fullfill the approvers requirements because:

  • We couldn't find the GitHub username of conanak99 in WorkDay (after adding your name, it can take up to 1h to sync the information). Read More

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

Labels

change:standard Not an emergency or impactful change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants