# Generate a new encryption keyindex_key = CyborgVectorStore.generate_key()print(f"Key length: {len(index_key)} bytes")# Use the key to create a storestore = CyborgVectorStore( index_name="secure_index", index_key=index_key, api_key="your-api-key", embedding="all-MiniLM-L6-v2", index_location=DBConfig("s3", bucket="secure-bucket"), config_location=DBConfig("s3", bucket="secure-bucket"))# Store the key securely for future useimport base64encoded_key = base64.b64encode(index_key).decode('utf-8')print(f"Base64 encoded key: {encoded_key}")
Store encryption keys securely! Never commit keys to version control or expose them in logs. Consider using a key management service for production deployments.