How do I prevent a user from storing mp3 files, so I can not distribute them?

4

First of all, it is worth mentioning that my question comes up following another question that I put here in the stackoverflow in pt and can be read in: Web Hosting or Streaming Hosting?

I'm developing a project that allows the user to listen (through a javaScript plugin) selected songs ... Songs / mp3 files are stored on the Server in a designated directory of uploads. The idea is to prevent mp3 files from being stored by the user who has the service ...

Here is an excerpt from the source code of the page that is sent to the browser:

<script type="text/javascript" src="plugin_player.js"></script>

<!--Front-End -->

<h2>Músicas</h2>

<div style='' class='main_thumbnails' id='mainThumbnailsHolder'>
    <div style='' class='thumbnail-wrapper'>
      <img style='width:100%;' alt='...' src='./uploads/1405414353.jpg' border='0'/>
      <button></button>
      <div style='width:100%;' class='info-thumbanail'>
        Artista: ... </br>Genero: ... </br>Tempo: ... </br>Publicado: ... </br>
      </div>
</div>
<div style='' class='thumbnail-wrapper'>
      <img style='width:100%;' alt='...' src='./uploads/1405413192.jpg' border='0'/>
      <button></button>
      <div style='width:100%;' class='info-thumbanail'>
        Artista: ... <br>Genero: ...<br>Tempo: ...<br>Publicado: ... <br>
      </div>
</div>
<!-- etc. -->
</div>


<!-- "Interface" onde o player (plugin javaScript)  irá "beber" as dados... -->
<ul id='playlists' style='display:none;'>
 <li data-source='playlist1' data-thumbnail-path='#'></li>
</ul>

<ul id='playlist1' style='display:none;'>
   <li data-path='uploads/1405414353.mp3' data-thumbpath='uploads/1405414353.jpg' data-      downloadable='no' data-duration='1:19:31'>string<p>
    <span style='font-weitgth:bold;'> ::.....:: </span> - ::.Artista.:: </p>
   </li>
   <li data-path='uploads/1405413192.mp3' data-thumbpath='uploads/1405413192.jpg' data-downloadable='no' data-duration='3:19'>string<p>
    <span style='font-weitgth:bold;'> ::.....:: </span> - ::.Artista.:: </p>
   </li>
</ul>

I do not know if I understand, because content security on servers is a very complex area.

    
asked by anonymous 18.07.2014 / 17:04

1 answer

2

Short answer: impossible to do. If the user can hear the audio on his computer, he can store a copy.

Detail: In the most extreme case, the user can connect the audio output of their sound card to the audio input of another sound card and record all the sound, thus creating their own MP3.

In less extreme cases, the user can retrieve the downloaded audio that is stored in some cache, or capture the audio streaming that was done, and save an MP3 file. Even if you protect it by encryption, which needs a specific program of yours on the user's computer, it can simply go to the previous case.

If this is not a problem for you, that is, you can accept that some users save the audios or that users reverse engineer your program so they can break your encryption, you could do the following:

  • a javascript plugin, to be run by the user, that generates a public-private key pair
  • the plugin sends the public key to your server
  • your server lists the music parameters for the user to choose
  • When the user chooses the song, his / her server generates a random symmetric key, encrypts it with the user's public key, and sends it to the user
  • the user receives the symmetric key, decrypts it, and keeps it in memory
  • Your server sends the streaming audio encrypted with the symmetric key to the user.
  • user to receive this streaming and decrypt with symmetric key received.
  • the plugin plays music.

And every time a user uses his service, he does the whole process of changing keys and encrypting.

    
18.07.2014 / 18:17