Over the holiday break I wrote cxporter, a
small command line tool in Go that converts credential exports from legacy providers into
Bitwarden import data. I had two reasons for building it:
I wanted to consolidate my vaults on Bitwarden without copy/pasting my way into a half-broken
result, and I wanted a real use case for Go's experimental runtime/secret package
(enabled with GOEXPERIMENT=runtimesecret). A tool that touches secrets by
definition seemed like the right place to try it.
Credential exports are dangerous artifacts. They are high-value plaintext files that tend to end up copied into temp folders, shell history, cloud-synced directories or forgotten downloads folders. On top of the handling risk, the format itself is loosely defined: every provider has its own model, with different field names, different notions of what a URI is, different custom-field semantics, and incompatible representations for things like TOTP seeds or attachments.
Worse, many migrations fail silently. The import reports success, but the data is subtly wrong, and you only find out the first time you need it.
The FIDO Alliance is working on a set of specifications under the "Credential Exchange" umbrella, with the goal of letting users move between credential managers without losing information or depending on proprietary export quirks. There are two parts:
The drafts cover real vault data rather than a "username + password" toy model: multiple URIs per item, custom fields, notes, and values like TOTP shared secrets that need careful encoding. This matters because a standard exchange model provides a neutral middle layer. Instead of writing N×M converters between providers, you aim for "provider → CX → provider". Even when there is only one destination (Bitwarden, in my case), an intermediate representation forces you to be explicit about every mapping decision: whether URIs keep their matching rules, whether custom fields keep their type, whether a non-password authentication factor survives the trip.
cxporter is conservative. Its design constraints:
io.Reader and json.Decoder instead of loading entire exports into memory.runtime/secret
The experimental runtime/secret package does not change the fact that a
migration has to decrypt the data at some point, and it is not a substitute for OS-level
hardening. What it addresses is a common class of mistakes: leaving sensitive data in
memory longer than necessary, or having it retained accidentally in registers, stack or
heap.
Unlike secret-management approaches based on special container types, this one wraps the
computation itself. The API is a single function, secret.Do(f func()): the
wrapped function runs with special handling, and when it returns, registers and stack
memory are zeroed and heap allocations made inside it are marked for erasure once the
garbage collector considers them unreachable. No manual tracking.
In cxporter, the sensitive part of the conversion pipeline runs inside a single call:
secret.Do(func() {
// decrypt and parse the export file
decryptedData := decryptExport(encryptedBytes, masterKey)
// convert to the intermediate format
items := parseCredentials(decryptedData)
// map to the target format
targetFormat := convertToBitwarden(items)
// temporary sensitive data is erased after this scope
})
The limitations are worth knowing:
For a single-threaded, self-contained operation like credential conversion, that is good enough, and it nudged me toward better defaults. Migration tooling is often written as one-off scripts, and scripts are where you accept risks you wouldn't take in a library: quick logging, quick debugging, "just load the whole file".
Migration tools fail in boring ways: a missing URL scheme changes matching behavior, TOTP seeds get mangled by normalization, notes get truncated, attachments disappear, custom fields drop quietly. The UI says "Import successful" either way, and you find out months later.
cxporter treats conversion as a schema-mapping problem with validation points:
The tool should either produce an import that matches what you expect, or stop and say why it can't.
A good break project: small enough to finish, and a reason to read CXP/CXF as an implementer instead of skimming headlines. If you plan a migration yourself: treat exports as hazardous material. Keep them local and short-lived, and verify the result instead of trusting the importer's success message. The code is at https://github.com/nvinuesa/cxporter.