Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
Encrypted video streaming

enter image description here

I made this picture that explains what I'm trying to achieve.

Brief summary: I want users to be able to upload an encrypted video that only those which have the password will be able to see as a stream. The point of all this is for the server to not be able to decipher it.

What I managed to do at the moment is only the first part, encrypting the chunks and sending them :

fileInput.addEventListener("change", async () => {
    const file = fileInput.files[0]
    const stream = file.stream()
    const reader = stream.getReader() 
    while(true) {
        const {value, done} = await reader.read()
        if(done) break
        handleChunk(value)
    }
    const out = {
        size: file.size,
        type: file.type,
        encryptedStream: encryptedStream
    }
})

function handleChunk(chunk) { // chunk: Uint8Array
    const parsedChunk = CryptoJS.enc.Utf8.parse(chunk)
    encryptedStream.push(CryptoJS.AES.encrypt(parsedChunk, "encryptionKey").toString())
}

I guess you can also do this with File.slice() but I did not test it.

At this point I feel like I've looked into every API related to files/streams both in Node and in vanilla js but I can't find a way to make this work, all I've managed is to make a Readable out of the encryptedStream array in the backend.

const Readable = require("stream").Readable
let readable = new Readable()
encryptedStream.forEach(aesChunk => readable.push(aesChunk))
readable.push(null)

I have doubts on how to stream it back to another frontend and literally no idea on how to play the video after deciphering it. From what I've looked online, it looks like it's not possible to stream a crypted file, only to download it.

Is this possible to do ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!