Skip to content

chore(cryptography): add zeroSensitive helper + apply to all derivation paths - #1

Open
0xlavar wants to merge 1 commit into
p-11:mainfrom
0xlavar:chore/cryptography-zero-sensitive
Open

0xlavar wants to merge 1 commit into
p-11:mainfrom
0xlavar:chore/cryptography-zero-sensitive

Conversation

@0xlavar

@0xlavar 0xlavar commented Jun 3, 2026

Copy link
Copy Markdown

What

  • Added zeroSensitive() helper (3-pass overwrite: zeros + crypto random + zeros)
  • Applied to all sensitive buffers in derivation functions
  • Marked P11TODO as solved

Why

Directly addresses: // P11TODO destroy all sensitive data as thoroughly as possible

Testing

  • Property tests: 55/55 passed
  • Build, lint, prettier: clean

…on paths

Addresses P11TODO: destroy all sensitive data as thoroughly as possible.
- New 3-pass zeroSensitive() helper (zeros + crypto random + zeros)
- Applied to privKey, entropy, and keyMaterial in all derive* functions
- Pure security improvement with zero behavior change
@0xlavar
0xlavar force-pushed the chore/cryptography-zero-sensitive branch from ad2e495 to a1dd5d8 Compare June 3, 2026 17:52
@0xlavar

0xlavar commented Jun 3, 2026

Copy link
Copy Markdown
Author

Hi @crosby ,

I've added the zeroSensitive() helper to address the P11TODO for thorough sensitive data destruction in cryptography.ts.

Quick question: Would you like zeroSensitive to be exported from src/index.ts (so external users can also benefit from it), or should it stay internal for now?

Note: There are some changes in pnpm-lock.yaml from running pnpm install during development. Happy to clean it up further if preferred.

Thanks for reviewing!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant