Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
save | bool | False | Whether to save/load the generated key to/from a file on your local machine |
Returns
bytes: A 32-byte object containing cryptographically secure random data suitable for index encryption.
Security Notes
The generated key is cryptographically secure and suitable for production use:- Uses Python’s
secrets.token_bytes()which leverages OS entropy sources for maximum security - Provides 256 bits of entropy (32 bytes)
- Compatible with AES-256 encryption used by CyborgDB
- If
save=True, the key is stored in the file~/.cyborgdb/index_keyfor future retrieval