Hide or obfuscate mp4 videos

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Hide or obfuscate mp4 videos

Post by Batninja » Sat Nov 11, 2017 12:13 pm

Hi

I’m working on an application that uses included mp4 videos with Indy Livecode. However the mp4 files are easily copied from the standalone resource folder. Aside from using encrypt/decrypt commands which I assume will take a while on a large video does anyone have any other suggestions to hide or prevent copying of included mp4 files?

All suggestions welcomed.

Thanks

Roger

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Hide or obfuscate mp4 videos

Post by bogs » Sat Nov 11, 2017 12:38 pm

Well, if the clips are really large, this may not work for you, but you could always import the clip into the stack itself, which would surely keep anyone from copying it from a folder, at least easily.
Comments:
Unlike a player, a video clip contains the movie that it displays. This increases the memory required by your stack, because the movie data is loaded into memory whenever the stack file is open. However, it prevents the movie from being accidentally separated from the stack file and lost.

Video clips can be in QuickTime, AVI, or MPEG format.

A video clip is contained in a stack. Video clips cannot contain other objects. (A video clip is not a control, since it has no user interface and cannot be owned by a card.)
Image

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: Hide or obfuscate mp4 videos

Post by Batninja » Sat Nov 11, 2017 12:41 pm

Thanks for the suggestion but the videos are actually part of a web page that I use the browser widget to display.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Hide or obfuscate mp4 videos

Post by richmond62 » Sat Nov 11, 2017 2:15 pm

Anyone can download video content from a webpage.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Hide or obfuscate mp4 videos

Post by bogs » Sun Nov 12, 2017 10:16 am

Batninja wrote:
Sat Nov 11, 2017 12:41 pm
Thanks for the suggestion but the videos are actually part of a web page that I use the browser widget to display.
Your welcome, and I will leave the reply to the way your first question was worded in case some future visitor has this question.

Craig is correct, though, if the video(s) are already on a webpage, I don't know that you can do much about it if anyone with a regular web browser can access them.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Hide or obfuscate mp4 videos

Post by richmond62 » Sun Nov 12, 2017 10:40 am

Who is Craig?

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Hide or obfuscate mp4 videos

Post by bogs » Sun Nov 12, 2017 11:53 am

Well, thats what my cat said your name was, but if your going to be that way about it :P

My apologies to richmond.
bogs wrote:
Sun Nov 12, 2017 10:16 am
Craig is correct, though, if the video(s) are already on a webpage, I don't know that you can do much about it if anyone with a regular web browser can access them.
should read
richmond is correct, though, if the video(s) are already on a webpage, I don't know that you can do much about it if anyone with a regular web browser can access them.
Image
Image

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: Hide or obfuscate mp4 videos

Post by Batninja » Mon Nov 13, 2017 9:41 pm

Hi thanks, but whilst the videos are embedded into a web page, the entire html page and mp4 is part of the application and loaded by the web browser widget on startup. I.e the page is not acquired from the internet but from the local resource folder. The URL is not identifiable to the user, it just looks like another card to them.

So I need a method to include a local file but make that file inaccessible to the user. :D

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Hide or obfuscate mp4 videos

Post by jiml » Mon Nov 13, 2017 11:05 pm

Well could you simply hide/show the folder containing the movies?

This works on macOS:

Code: Select all

constant hidName = "/resources/.movies", visName = "/resources/movies"

on showMovieFolder how
   if how = true then
      rename folder hidName to visName
   else
      rename folder visName to hidName
   end if   
end showMovieFolder
See here for other Ones:
https://en.wikipedia.org/wiki/Hidden_fi ... _directory

Jim Lambert

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: Hide or obfuscate mp4 videos

Post by Batninja » Tue Nov 14, 2017 10:52 am

Thanks for the suggestion, however the hidden folder can still be accessed by a user if they turn hidden folders off (in Windows for example).

I think I have an approach that might work from reading another post about changing the bytes in the file i.e.

In development
1. Use the live code command Open file (specialfolderpath/video.mp4) for update
2. Append a few bytes to the start of the video file so it cannot be played
3. Manually rename the video file from video.mp4 to video.dat

On application launch, use live code to
1. Open file (specialfolderpath/video.dat) for update
2. Remove the few bytes from the start to revert the file to original
3. Change video.dat name to video.mp4 (so that the html page can load it)

This would not stop a determined hacker but would deter most regular users from accessing the video file.

If anyone can help with the steps 2 above i.e. Append bytes and Remove bytes using the Open file command directly on a file (i.e. not via a text field, since the video is too large) I'd be really grateful.

Roger

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Hide or obfuscate mp4 videos

Post by shaosean » Tue Nov 14, 2017 1:10 pm

If the videos are already on the end user's computer, you can Base64 encode the videos and embed them direct in to the HTML.. Obviously only you will know if this works for you.. You could always Base64 encode the videos and save them as .dat files and then do a replace on the HTML file with that data, that way your HTML files are kept small (and perhaps are part of the LiveCode stack)..

Code: Select all

<video><source type="video/mp4" src="data:video/mp4;base64,%BASE64_ENCODED_VIDEO"></video>

Post Reply

Return to “Talking LiveCode”