Authenticator App

Backup file format

Your backup should outlive this app. This page documents the format, so a .authbackup file can be opened with only your Recovery Key, even if Authenticator App disappears.

Download the decryption script (Python, needs the cryptography package).

pip install cryptography
python3 decrypt_backup.py backup.authbackup > codes.txt

The output holds your secrets in plain text. Delete it when you are done.

File

A UTF-8 JSON document. Binary fields are Base64.

{
  "header": {
    "format": "lifeboat-vault",
    "version": 1,
    "vaultID": "UUID",
    "snapshotID": "UUID",
    "sequence": 12,
    "keyGeneration": 1,
    "createdAtMillis": 1795408000000
  },
  "recovery": {
    "kdf": "HKDF-SHA256",
    "salt": "32 random bytes",
    "wrappedKey": "nonce (12) || ciphertext (32) || tag (16)"
  },
  "payload": "nonce (12) || ciphertext || tag (16)"
}

Recovery Key

55 characters of Crockford Base32 (0-9 A-Z without I, L, O, U), holding 32 random bytes followed by a 2-byte checksum: the first two bytes of SHA-256("lifeboat.v1.recovery-checksum" || key). The last 3 bits are zero.

Decryption

UUIDs below are lowercase.

KEK = HKDF-SHA256(
  ikm  = recovery key,
  salt = recovery.salt,
  info = "lifeboat.v1.recovery-kek|{vaultID}|{keyGeneration}",
  L    = 32)

vault key = AES-256-GCM-open(KEK, recovery.wrappedKey,
  aad = "lifeboat.v1.wrap|{vaultID}|{keyGeneration}")

padded = AES-256-GCM-open(vault key, payload,
  aad = "{format}|{version}|{vaultID}|{snapshotID}|{sequence}|{keyGeneration}|{createdAtMillis}")

The plaintext uses ISO/IEC 7816-4 padding to a multiple of 4096 bytes: remove trailing zero bytes, then one 0x80 byte.

Accounts

The plaintext is a JSON array:

[{
  "id": "UUID",
  "issuer": "GitHub",
  "label": "name@example.com",
  "secret": "Base64 of the raw secret",
  "algorithm": "SHA1 | SHA256 | SHA512",
  "digits": 6,
  "kind": { "type": "totp", "period": 30 },
  "domain": "github.com",
  "note": "",
  "isPinned": false,
  "hasRecoveryCodes": true,
  "createdAt": 1795408000000,
  "updatedAt": 1795408000000
}]

For counter-based codes, kind is { "type": "hotp", "counter": 7 }.