Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda