2021-10-11, 03:32
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):
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:
Change '<VIDEO>' to your file.
Now you can play this encyrpted file in ffplay (also works in vlc):
This demonstrates the playback of encrypted files using ffmpeg, just so that we've verified that this actually works
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
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)
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
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
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