Documentation
¶
Overview ¶
Package archivecrypt is the format of encrypted archive objects and wrapped data keys (G6-07), shared by the archiver and `wtctl archive decrypt`. Objects are `"WTE1" ‖ nonce(12) ‖ AES-256-GCM(data key, aad = project id text)`; a data key is wrapped as `0x01 ‖ 0x01 ‖ nonce(12) ‖ ciphertext` (the wt-secrets format) under HKDF-SHA256(WT_SECRET_KEY, salt "watchtower", info DataKeyInfo), aad = the project's uuid bytes.
Index ¶
- Constants
- Variables
- func IsEncrypted(b []byte) bool
- func NewDataKey() ([]byte, error)
- func Open(dk []byte, project string, b []byte) ([]byte, error)
- func Seal(dk []byte, project string, data []byte) ([]byte, error)
- func Unwrap(master string, project uuid.UUID, sealed []byte) ([]byte, error)
- func Wrap(master string, project uuid.UUID, dk []byte) ([]byte, error)
Constants ¶
const DataKeyInfo = "wt/tenant-data-key/v1"
DataKeyInfo is the HKDF info of the key that wraps data keys.
Variables ¶
var Magic = []byte("WTE1")
Magic starts every encrypted object.
Functions ¶
func IsEncrypted ¶
IsEncrypted reports whether b is an encrypted object (anything else is legacy plaintext).
Types ¶
This section is empty.