Android cast playing a video with custom encryptionIs there a way to run Python on Android?How do save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Is there a unique Android device ID?What is 'Context' on Android?Android: Play video from file bufferProper use cases for Android UserManager.isUserAGoat()?Play video from ByteArrayOutputStream on androidPlaying Encrypted audiobook mp3 android and ios

Any examples of liquids volatile at room temp but non-flammable?

When an imagined world resembles or has similarities with a famous world

Why am I receiving the identity insert error even after explicitly setting IDENTITY_INSERT ON and using a column list?

When does tabularx decide to break the cell entry instead of reducing the columns separation?

Will 700 more planes a day fly because of the Heathrow expansion?

ListPointPlot3D filling between two lists

What is the closest airport to the center of the city it serves?

Which US defense organization would respond to an invasion like this?

Python 3 - simple temperature program

What to use instead of cling film to wrap pastry

How long would it take for people to notice a mass disappearance?

What was the first story to feature the plot "the monsters were human all along"?

Would a small hole in a Faraday cage drastically reduce its effectiveness at blocking interference?

Which sphere is fastest?

Why didn't this character get a funeral at the end of Avengers: Endgame?

Is Soreness in Middle Knuckle of Fretting Hand Index Finger Normal for Beginners?

Why symmetry transformations have to commute with Hamiltonian?

Is disk brake effectiveness mitigated by tyres losing traction under strong braking?

Has the United States ever had a non-Christian President?

How can Internet speed be 10 times slower without a router than when using the same connection with a router?

Is an HNN extension of a virtually torsion-free group virtually torsion-free?

Checking if two expressions are related

Can my 2 children, aged 10 and 12, who are US citizens, travel to the USA on expired American passports?

As a GM, is it bad form to ask for a moment to think when improvising?



Android cast playing a video with custom encryption


Is there a way to run Python on Android?How do save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Is there a unique Android device ID?What is 'Context' on Android?Android: Play video from file bufferProper use cases for Android UserManager.isUserAGoat()?Play video from ByteArrayOutputStream on androidPlaying Encrypted audiobook mp3 android and ios






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have an android app that plays some video content. The video is mp4 with some simple custom encryption.
In android the player (ExoPlayer) decrypts the video in real time while playing.



It uses a code like this:



// overriding the function that reads the video file to insert the decryption
public int read(byte[] buffer, int offset, int readLength) throws FileDataSourceException
// ...
// buffer[] holds the video bits, decrypt them here
buffer[offset] = (byte)(buffer[offset] ^ 1234);

// ...

}


I now want to add support for Chrome cast - to be able to stream the video from a mobile phone to tv.



However looking at the api I cannot see a way to implement my decryption algorithm.
From what I see it supports either unencrypted videos or videos with some standard DRM.



Is it possible to implement a custom encryption, similar to the code above?










share|improve this question



















  • 1





    If your looking for DRM of Chromecast support, there is an available blogpost about the support of DRM encryption on the ChocoTv. This will let Chromecast support HLS AES-128 encryption for Android Platform. Check this site for more details.

    – jess
    Mar 22 at 9:23












  • @jess thanks, I'll take a look. I was hoping to avoid using the standard encryption/drm algorithms and go with something simple as shown in the code above (i just added it). But it looks like I may need to go this way.

    – Lacho Tomov
    Mar 22 at 9:34











  • If you're looking for actual security, unless you have a PHD in math, give up on the idea of writing anything yourself. The difficulty in writing an effective encryption mechanism is immense.

    – Gabe Sechan
    Mar 23 at 0:50











  • @GabeSechan actually implementing something simple like XOR encryption is quite easy and it will guard against 99% of the attackers. The remaining 1% will break it, but they will break your DRM encryption as well, so in many cases it's not worth the time and effort.

    – Lacho Tomov
    Mar 23 at 15:12











  • No, it isn't. While a otp is unbreakable if not reused, you will be reusing it constantly, and you aren't even thinking about key exchange. You aren't actually giving it any real security, just the veneer of it. And if you think anyone is breaking aes outside the NSA, you're insane. Just use an existing algorithm and a library for it (to minimize your chance of worrying a side channel attack)

    – Gabe Sechan
    Mar 23 at 16:07


















1















I have an android app that plays some video content. The video is mp4 with some simple custom encryption.
In android the player (ExoPlayer) decrypts the video in real time while playing.



It uses a code like this:



// overriding the function that reads the video file to insert the decryption
public int read(byte[] buffer, int offset, int readLength) throws FileDataSourceException
// ...
// buffer[] holds the video bits, decrypt them here
buffer[offset] = (byte)(buffer[offset] ^ 1234);

// ...

}


I now want to add support for Chrome cast - to be able to stream the video from a mobile phone to tv.



However looking at the api I cannot see a way to implement my decryption algorithm.
From what I see it supports either unencrypted videos or videos with some standard DRM.



Is it possible to implement a custom encryption, similar to the code above?










share|improve this question



















  • 1





    If your looking for DRM of Chromecast support, there is an available blogpost about the support of DRM encryption on the ChocoTv. This will let Chromecast support HLS AES-128 encryption for Android Platform. Check this site for more details.

    – jess
    Mar 22 at 9:23












  • @jess thanks, I'll take a look. I was hoping to avoid using the standard encryption/drm algorithms and go with something simple as shown in the code above (i just added it). But it looks like I may need to go this way.

    – Lacho Tomov
    Mar 22 at 9:34











  • If you're looking for actual security, unless you have a PHD in math, give up on the idea of writing anything yourself. The difficulty in writing an effective encryption mechanism is immense.

    – Gabe Sechan
    Mar 23 at 0:50











  • @GabeSechan actually implementing something simple like XOR encryption is quite easy and it will guard against 99% of the attackers. The remaining 1% will break it, but they will break your DRM encryption as well, so in many cases it's not worth the time and effort.

    – Lacho Tomov
    Mar 23 at 15:12











  • No, it isn't. While a otp is unbreakable if not reused, you will be reusing it constantly, and you aren't even thinking about key exchange. You aren't actually giving it any real security, just the veneer of it. And if you think anyone is breaking aes outside the NSA, you're insane. Just use an existing algorithm and a library for it (to minimize your chance of worrying a side channel attack)

    – Gabe Sechan
    Mar 23 at 16:07














1












1








1


1






I have an android app that plays some video content. The video is mp4 with some simple custom encryption.
In android the player (ExoPlayer) decrypts the video in real time while playing.



It uses a code like this:



// overriding the function that reads the video file to insert the decryption
public int read(byte[] buffer, int offset, int readLength) throws FileDataSourceException
// ...
// buffer[] holds the video bits, decrypt them here
buffer[offset] = (byte)(buffer[offset] ^ 1234);

// ...

}


I now want to add support for Chrome cast - to be able to stream the video from a mobile phone to tv.



However looking at the api I cannot see a way to implement my decryption algorithm.
From what I see it supports either unencrypted videos or videos with some standard DRM.



Is it possible to implement a custom encryption, similar to the code above?










share|improve this question
















I have an android app that plays some video content. The video is mp4 with some simple custom encryption.
In android the player (ExoPlayer) decrypts the video in real time while playing.



It uses a code like this:



// overriding the function that reads the video file to insert the decryption
public int read(byte[] buffer, int offset, int readLength) throws FileDataSourceException
// ...
// buffer[] holds the video bits, decrypt them here
buffer[offset] = (byte)(buffer[offset] ^ 1234);

// ...

}


I now want to add support for Chrome cast - to be able to stream the video from a mobile phone to tv.



However looking at the api I cannot see a way to implement my decryption algorithm.
From what I see it supports either unencrypted videos or videos with some standard DRM.



Is it possible to implement a custom encryption, similar to the code above?







android chromecast drm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 9:30







Lacho Tomov

















asked Mar 21 at 8:01









Lacho TomovLacho Tomov

1,2261524




1,2261524







  • 1





    If your looking for DRM of Chromecast support, there is an available blogpost about the support of DRM encryption on the ChocoTv. This will let Chromecast support HLS AES-128 encryption for Android Platform. Check this site for more details.

    – jess
    Mar 22 at 9:23












  • @jess thanks, I'll take a look. I was hoping to avoid using the standard encryption/drm algorithms and go with something simple as shown in the code above (i just added it). But it looks like I may need to go this way.

    – Lacho Tomov
    Mar 22 at 9:34











  • If you're looking for actual security, unless you have a PHD in math, give up on the idea of writing anything yourself. The difficulty in writing an effective encryption mechanism is immense.

    – Gabe Sechan
    Mar 23 at 0:50











  • @GabeSechan actually implementing something simple like XOR encryption is quite easy and it will guard against 99% of the attackers. The remaining 1% will break it, but they will break your DRM encryption as well, so in many cases it's not worth the time and effort.

    – Lacho Tomov
    Mar 23 at 15:12











  • No, it isn't. While a otp is unbreakable if not reused, you will be reusing it constantly, and you aren't even thinking about key exchange. You aren't actually giving it any real security, just the veneer of it. And if you think anyone is breaking aes outside the NSA, you're insane. Just use an existing algorithm and a library for it (to minimize your chance of worrying a side channel attack)

    – Gabe Sechan
    Mar 23 at 16:07













  • 1





    If your looking for DRM of Chromecast support, there is an available blogpost about the support of DRM encryption on the ChocoTv. This will let Chromecast support HLS AES-128 encryption for Android Platform. Check this site for more details.

    – jess
    Mar 22 at 9:23












  • @jess thanks, I'll take a look. I was hoping to avoid using the standard encryption/drm algorithms and go with something simple as shown in the code above (i just added it). But it looks like I may need to go this way.

    – Lacho Tomov
    Mar 22 at 9:34











  • If you're looking for actual security, unless you have a PHD in math, give up on the idea of writing anything yourself. The difficulty in writing an effective encryption mechanism is immense.

    – Gabe Sechan
    Mar 23 at 0:50











  • @GabeSechan actually implementing something simple like XOR encryption is quite easy and it will guard against 99% of the attackers. The remaining 1% will break it, but they will break your DRM encryption as well, so in many cases it's not worth the time and effort.

    – Lacho Tomov
    Mar 23 at 15:12











  • No, it isn't. While a otp is unbreakable if not reused, you will be reusing it constantly, and you aren't even thinking about key exchange. You aren't actually giving it any real security, just the veneer of it. And if you think anyone is breaking aes outside the NSA, you're insane. Just use an existing algorithm and a library for it (to minimize your chance of worrying a side channel attack)

    – Gabe Sechan
    Mar 23 at 16:07








1




1





If your looking for DRM of Chromecast support, there is an available blogpost about the support of DRM encryption on the ChocoTv. This will let Chromecast support HLS AES-128 encryption for Android Platform. Check this site for more details.

– jess
Mar 22 at 9:23






If your looking for DRM of Chromecast support, there is an available blogpost about the support of DRM encryption on the ChocoTv. This will let Chromecast support HLS AES-128 encryption for Android Platform. Check this site for more details.

– jess
Mar 22 at 9:23














@jess thanks, I'll take a look. I was hoping to avoid using the standard encryption/drm algorithms and go with something simple as shown in the code above (i just added it). But it looks like I may need to go this way.

– Lacho Tomov
Mar 22 at 9:34





@jess thanks, I'll take a look. I was hoping to avoid using the standard encryption/drm algorithms and go with something simple as shown in the code above (i just added it). But it looks like I may need to go this way.

– Lacho Tomov
Mar 22 at 9:34













If you're looking for actual security, unless you have a PHD in math, give up on the idea of writing anything yourself. The difficulty in writing an effective encryption mechanism is immense.

– Gabe Sechan
Mar 23 at 0:50





If you're looking for actual security, unless you have a PHD in math, give up on the idea of writing anything yourself. The difficulty in writing an effective encryption mechanism is immense.

– Gabe Sechan
Mar 23 at 0:50













@GabeSechan actually implementing something simple like XOR encryption is quite easy and it will guard against 99% of the attackers. The remaining 1% will break it, but they will break your DRM encryption as well, so in many cases it's not worth the time and effort.

– Lacho Tomov
Mar 23 at 15:12





@GabeSechan actually implementing something simple like XOR encryption is quite easy and it will guard against 99% of the attackers. The remaining 1% will break it, but they will break your DRM encryption as well, so in many cases it's not worth the time and effort.

– Lacho Tomov
Mar 23 at 15:12













No, it isn't. While a otp is unbreakable if not reused, you will be reusing it constantly, and you aren't even thinking about key exchange. You aren't actually giving it any real security, just the veneer of it. And if you think anyone is breaking aes outside the NSA, you're insane. Just use an existing algorithm and a library for it (to minimize your chance of worrying a side channel attack)

– Gabe Sechan
Mar 23 at 16:07






No, it isn't. While a otp is unbreakable if not reused, you will be reusing it constantly, and you aren't even thinking about key exchange. You aren't actually giving it any real security, just the veneer of it. And if you think anyone is breaking aes outside the NSA, you're insane. Just use an existing algorithm and a library for it (to minimize your chance of worrying a side channel attack)

– Gabe Sechan
Mar 23 at 16:07













1 Answer
1






active

oldest

votes


















1














The new CAF framework provides three different options:



  • Styled Media Receiver

  • Custom Receiver

  • Default Media Receiver

The only one which supports DRM is the custom receiver and as you say it is designed for the standard DRM's.



However it should support CENC clear key which may be enough protection for your needs and will allow you avoid using a DRM service.



CENC clear key has the key in the clear as the name suggests. It is not very secure but it may be enough of a 'hurdle' (which is essentially what most security systems are) for you anyway.






share|improve this answer

























  • CENC sounds like a good option, I'll investigate it deeper. Thanks!

    – Lacho Tomov
    Mar 22 at 11:34











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55275971%2fandroid-cast-playing-a-video-with-custom-encryption%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














The new CAF framework provides three different options:



  • Styled Media Receiver

  • Custom Receiver

  • Default Media Receiver

The only one which supports DRM is the custom receiver and as you say it is designed for the standard DRM's.



However it should support CENC clear key which may be enough protection for your needs and will allow you avoid using a DRM service.



CENC clear key has the key in the clear as the name suggests. It is not very secure but it may be enough of a 'hurdle' (which is essentially what most security systems are) for you anyway.






share|improve this answer

























  • CENC sounds like a good option, I'll investigate it deeper. Thanks!

    – Lacho Tomov
    Mar 22 at 11:34















1














The new CAF framework provides three different options:



  • Styled Media Receiver

  • Custom Receiver

  • Default Media Receiver

The only one which supports DRM is the custom receiver and as you say it is designed for the standard DRM's.



However it should support CENC clear key which may be enough protection for your needs and will allow you avoid using a DRM service.



CENC clear key has the key in the clear as the name suggests. It is not very secure but it may be enough of a 'hurdle' (which is essentially what most security systems are) for you anyway.






share|improve this answer

























  • CENC sounds like a good option, I'll investigate it deeper. Thanks!

    – Lacho Tomov
    Mar 22 at 11:34













1












1








1







The new CAF framework provides three different options:



  • Styled Media Receiver

  • Custom Receiver

  • Default Media Receiver

The only one which supports DRM is the custom receiver and as you say it is designed for the standard DRM's.



However it should support CENC clear key which may be enough protection for your needs and will allow you avoid using a DRM service.



CENC clear key has the key in the clear as the name suggests. It is not very secure but it may be enough of a 'hurdle' (which is essentially what most security systems are) for you anyway.






share|improve this answer















The new CAF framework provides three different options:



  • Styled Media Receiver

  • Custom Receiver

  • Default Media Receiver

The only one which supports DRM is the custom receiver and as you say it is designed for the standard DRM's.



However it should support CENC clear key which may be enough protection for your needs and will allow you avoid using a DRM service.



CENC clear key has the key in the clear as the name suggests. It is not very secure but it may be enough of a 'hurdle' (which is essentially what most security systems are) for you anyway.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 25 at 10:42

























answered Mar 22 at 10:58









MickMick

12.7k12464




12.7k12464












  • CENC sounds like a good option, I'll investigate it deeper. Thanks!

    – Lacho Tomov
    Mar 22 at 11:34

















  • CENC sounds like a good option, I'll investigate it deeper. Thanks!

    – Lacho Tomov
    Mar 22 at 11:34
















CENC sounds like a good option, I'll investigate it deeper. Thanks!

– Lacho Tomov
Mar 22 at 11:34





CENC sounds like a good option, I'll investigate it deeper. Thanks!

– Lacho Tomov
Mar 22 at 11:34



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55275971%2fandroid-cast-playing-a-video-with-custom-encryption%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현