N
N
nivs2014-03-23 20:24:41
linux
nivs, 2014-03-23 20:24:41

How to implement C++ binary stream encryption?

There was a task to implement enciphering of the stream coming on RTSP with h264 contents. At the moment I write to the file using libVLC (openCV running through FFmpeg artifacts the content very much, linVLC only the first 6-10 seconds) ( pastebin.com/WatFnF46 ), then scan the file for new content, encrypt and write to the file for subsequent decryption ( pastebin.com/zHXnejAU ), but 70 MB of the movie turns into 1.1 GB of encrypted data (which I never managed to decrypt), and this is unacceptable.
At the same time, I do not like to use the file as an intermediate buffer between recording and encryption, it takes up extra space, which is only 50 GB, and the video can be about 20-30 GB. I wanted to use Linux named pipes (record video to a socket previously created using mkfifo), but nothing came of it.
Tell me, please, what tools should I use in my case, what algorithm should I follow? I practically do not know how to program in C ++, and the problem needs to be solved as soon as possible. The software will run on a dual-core Intel Atom, so you need something that consumes little CPU.
In general, the task pursued is to make sure that no other video file is thrown instead of the original one, so maybe encryption of 5-10% of the file will do, maybe there are some signatures, something else like that, then work through pipes is not needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vans239, 2014-03-23
@nivs

You don't need encryption, you need en.wikipedia.org/wiki/Hash-based_message_authentic...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question