Reputation: 311
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:
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?
Upvotes: 2
Views: 483
Reputation: 935
As far as i understood your question, you propably do not need to add signature into each RTMP packet. RTMP connection sets once for a client and begins with a handshake. C1 packet is 1536 bytes long and has a Random data (1528 bytes) which is:
This field can contain any arbitrary values. Since each endpoint has to distinguish between the response to the handshake it has initiated and the handshake initiated by its peer,this data SHOULD send something sufficiently random. But there is no need for cryptographically-secure randomness, or even dynamic values.
You can use it to pass your hashes and authenticate client on server side, if everything is ok — proceed connection or just close it if something goes wrong.
Upvotes: 1