Skip to content

secureWipe()

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / secureWipe

secureWipe(buffer): void

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:3464

Securely wipe a buffer containing sensitive data

This performs a defense-in-depth wipe:

  1. Overwrite with random data (defeats simple memory scrapers)
  2. Zero the buffer (standard cleanup)

Note: Due to JavaScript’s garbage collection and potential JIT optimizations, this cannot guarantee complete erasure. However, it provides significant improvement over leaving secrets in memory.

Uint8Array

The buffer to wipe (modified in place)

void

const secretKey = randomBytes(32)
// ... use the key ...
secureWipe(secretKey) // Clean up when done