How to prevent a user from storing mp3 files, thus preventing them from being able to distribute them?

Asked

Viewed 321 times

4

First of all, it is good to mention that my doubt arises following another question that I put here in stackoverflow in pt and that can be read in: Web Hosting or Streaming Hosting?

I am developing a project that allows the user to listen (through a Avascript plugin) selected songs... The music/mp3 files are stored on the Server in a directory called "uploads". The idea is to prevent mp3 files from being stored by the user using 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 don’t know if I made myself clear, because the security of content on servers is a very complex area.

  • 4

    If a javascript system can get it, then any user can. You can try doing a streaming server instead of storing it directly in files. And yet, it can merely record audio from PC.

  • Probably only using a player of its own and encoding the information in a different way than traditional (or encrypting, or using non-standard formats). And even then, a digital recording can still be made using a virtual audio output on the pc.

1 answer

2

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

Detailing: in the most extreme case, the user can connect the audio output from his sound card to the audio input from another sound card and record all the sound, thus creating his 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 has been done, and save an MP3 file. Even if you protect this by encryption, which needs a specific program from you 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 do some reverse engineering on your program, and 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 publish key to your server
  • your server lists the music parameters for the user to choose
  • when the user chooses the song, your 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 audio (streaming) encrypted with the symmetric key to the user.
  • user receive this streaming and decryption with the symmetric key received.
  • the plugin plays the music.

And each time a user uses your service, it does the whole process of switching keys and encrypting.

  • I appreciate the information. But, it is not too much to mention that my doubt arises following another question that I put here at stackoverflow in pt and that can be read at: http://answall.com/questions/25795/homestay

  • um, edit your original question and put this: that you have already asked another question, and by her answers, you have the following question: and here comes your question above. Makes it easier for others to know

Browser other questions tagged

You are not signed in. Login or sign up in order to post.