-3

I just want to make the video source encrypted and stay away from user want download the video. So how can i encrypt the video source?

Can we make the encrypt url of the video with html & css? If not, how to do it in another language?

2 Answers2

0

// Define the string
var href = 'https://www.bigbuckbunny.org/';

// Encode the String
var encodedString = btoa(href);
console.log('encodedString : ', encodedString);

// Decode the String
var decodedString = atob(encodedString);
console.log('decodedString : ', decodedString);

you can use native base64 for decoding and encoding strings

atob()

btoa()

Encrypt

btoa("https://www.bigbuckbunny.org/");

Shiv Kumar Baghel
  • 2,464
  • 6
  • 18
  • 34
  • Keep in mind that **it won't prevent the download**, just make it a little harder. *User just have to write `atob(url);` in his console.* – Maarti Oct 24 '18 at 03:57
  • yes i gave the reference to https://stackoverflow.com/questions/23344117/disable-html5-video-download where we have same scenario . Question Author specify `how to encrypt the video url in html`. so gave example for simple encrypt of string – Shiv Kumar Baghel Oct 24 '18 at 04:09
  • This is NOT encryption. – Tero Sep 14 '21 at 17:18
0

If you "encrypt" the URL while your user's browser need the URL of the video, this means that your user's browser can "decrypt" it. So the user can also do it.

So you can't but you can make it harder to download.

Maarti
  • 3,600
  • 4
  • 17
  • 34