Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Play encrypted (AES128) file in kodi?
#1
Hi,

As far as i know, KODI internally uses FFmpeg. They have the "crypto" protocol which allows playback of encrypted videos.

To give a bit of a feel of how this works, i'll demonstrate exactly how this is done in ffmpeg.

First, we generate the AES key and IV (Initialization Vector):
Code:
export AES_KEY=$(openssl rand -hex 16)
export AES_IV=$(openssl rand -hex 16)
Store thee in a file somewhere (you can see them by typing "env" and looking for "AES_KEY" and "AES_IV"), you need them both later on to play the file.

Then we encrypt a video file using openssl and this command:
Code:
openssl enc -aes-128-cbc -K $AES_KEY -iv $AES_IV -in <VIDEO> -out <VIDEO>.enc
Change '<VIDEO>' to your file.

Now you can play this encyrpted file in ffplay (also works in vlc):
Code:
ffplay crypto://<video>.enc -decryption_key $AES_KEY -decryption_iv $AES_IV
This demonstrates the playback of encrypted files using ffmpeg, just so that we've verified that this actually works Smile

I now want to be able to play this encrypted file in KODI, but how?
I'm looking for a way to instruct KODI to play the file through the "crypto" protocol.
I'm also looking for a way to set the AES key and IV as those will be quite hard requirements to get this working at all.

Any help would be greatly appreciated!

Best regards,
Mark
Reply
#2
Funny when reading it back. I made a few typos, lol.
Can't change them apparently. Probably because it's the main topic post?

Anyhow, bump. I'm now also looking into the route of patching the addon "inputstream.ffmpegdirect" to make this possible. I still hope it already is possible and i just don't know how yet Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Play encrypted (AES128) file in kodi?0