npm install videocryptor
To use video-cryptor, you need to import it into your Node.js project:
import videoCryptor from "videocryptor";
const video = new VideoCryptor();
To encrypt a video, you'll need the path to the video file, an encryption key, and the desired output file path. Here's how to use the library to encrypt a video:
const videoPath = "./demo.mp4";
const encryptionKey = "your-secret-key";
const encryptedFilePath = "encrypted-video";
video.videoEncrypt(videoPath, encryptionKey, encryptedFilePath);
To decrypt an encrypted video, you'll need the path to the encrypted video file, the encryption key used for encryption, and the desired output file path. Here's how to use the library to decrypt an encrypted video:
const encryptedFilePath = "encrypted-video";
const encryptionKey = "your-secret-key";
const decryptedVideoPath = "decrypted-video";
video.videoDecrypt(encryptedFilePath, encryptionKey, decryptedVideoPath);
Ashish Singh (GitHub)