Sunday, 9 June 2019

Is it possible to insert additional data for each packet inside the RTMP protocol?

I'm currently working on a simple implementation of the streaming platform used in the movie and the books the circle.

In the story secrets are lies and every data should be accessible to everyone. Users can stream their data to a server which allows users to watch. Now the stream should have integrity checks but should not encrypt its data with the purpose of hiding information. To solve this I wanted to:

  • Setup a client (android) that streams their camera over RTMP and sends a digital signature as way of providing authentication, non repudiation and a way to check the integrity.
  • Setup a server that takes in the data, confirms the identity of the stream by reading out the signature and validating the hash. The server then relays this stream to the webclient..
  • Have a web client where viewers can watch the stream, while also having the same type of security as used by publishing the stream.

Now there are a few ways I thought about implementing this, but the most beautiful way without impacting latency a lot would be to modify the RTMP packets to be able to send additional data along every step. I read in the official docs for RTMP that the header leaves room for only 2 bytes which isn't enough to support a sha256 signature. Now I'm not a streaming protocol expert so any additional help besides pointing me at the docs would be greatly appreciated.

I have had succes by calling the OnMetaData but this is only send once per stream, so it leaves the stream vulnerable after the initial handshake. I have mainly worked with the Node-Media-Server package.

TLDR: Need a way to add a digital signature to my RTMP protocol, for science. Am I thinking about this the wrong way? Is it possible to insert the hash in the packet? Or is this the wrong approach all together?



from Is it possible to insert additional data for each packet inside the RTMP protocol?

No comments:

Post a Comment