Encryption
Encrypt a video's files with AES-128 or DRM, their keys handed only to who may watch.
import { Crumbcast } from "crumbcast"; const crumbcast = new Crumbcast({ token: process.env.CRUMBCAST_TOKEN, baseUrl: "https://your-crumbcast",}); const video = await crumbcast.videos.getVideo({ id: videoId,}); // DRM where your Crumbcast offers it, AES-128 otherwiseconst protection = video.drm_offered ? "drm" : "aes"; // Every format is encoded again: it plays once one isawait crumbcast.videos.setProtection({ id: videoId, protectionRequest: { protection },});import os from crumbcast import Crumbcast crumbcast = Crumbcast( token=os.environ["CRUMBCAST_TOKEN"], base_url="https://your-crumbcast",) video = crumbcast.videos.get_video(video_id) # DRM where your Crumbcast offers it, AES-128 otherwiseprotection = "drm" if video["drm_offered"] else "aes" # Every format is encoded again: it plays once one iscrumbcast.videos.set_protection( video_id, body={"protection": protection},)use Crumbcast\Crumbcast; $crumbcast = new Crumbcast( token: getenv('CRUMBCAST_TOKEN'), baseUrl: 'https://your-crumbcast',); $video = $crumbcast->videos->getVideo($videoId); // DRM where your Crumbcast offers it, AES-128 otherwise$protection = ($video['drm_offered'] ?? false) ? 'drm' : 'aes'; // Every format is encoded again: it plays once one is$crumbcast->videos->setProtection($videoId, [ 'protection' => $protection,]);const api = "https://your-crumbcast/api/v1";const headers = { Authorization: `Bearer ${process.env.CRUMBCAST_TOKEN}`, "Content-Type": "application/json",}; const video = await fetch(`${api}/videos/${videoId}/`, { headers }) .then((response) => response.json()); // DRM where your Crumbcast offers it, AES-128 otherwiseconst protection = video.drm_offered ? "drm" : "aes"; // Every format is encoded again: it plays once one isawait fetch(`${api}/videos/${videoId}/protection/`, { method: "PUT", headers, body: JSON.stringify({ protection }),});What you get
- AES-128Every rendition encrypted whole, its key served only with its playlist.
- DRMPlayed with a licence, where DRM is set up.
- Never at a lasting addressEncrypted files stay on a storage without a public URL, reached only through short-lived signed links.
- Live streams tooEach segment of a live stream encrypted with AES-128, from its next broadcast.