How to apply DRM on a .mp3/.wav file - drm

Can anyone help me to apply DRM on .mp3 or .wav. I know about DRM, but i have no idea about it's implementation process. If anyone has any idea on DRM's implementation(for .mp3/.wav) pleae help me. It would be great if this is for C#. It would be nice if any of you give me some Source/link.
Thanks
Pranab

To DRM any sort of file, all you are really doing is encrypting it in such a way that only authorized clients (programs) can retrieve the content from the file. Typically, this requires special client software. Depending on your requirements, it may also require a central server for these clients to call back to.
In general, you cannot simple "DRM an .mp3", because a generic MP3 player cannot read the data then. (if it could, it wouldn't be a DRMed file then, now would it?)

Possible, yes. Easy, not so much:
The "easiest" way is to drop the MP3 or WAV requirement and go with WMA (Windows Media Audio). In that case, you could use the Microsoft PlayReady Server SDK (expensive - several tens of thousand $) to do Windows Media DRM-compatible encryption. The resulting encrypted WMA can then be played by Windows Media Player and by a very large number of portable devices, after having received a "license" (essentially, decryption key + usage rights).
If you decide to go with WMA and you can't do large upfront investments, perhaps a hosted (SaaS) solution such as BuyDRM is for you.
Another possibility, which requires an even larger investment, if you want to stick with MP3 or WAV, is to use PlayReady itself with the "Envelope" format, or OMA 2 DRM with the "DCF" format, or Marlin DRM, or several other ones, which in addition to investing on the server side would also require you to write a custom media player.

Related

How download a MPEG Dash with DRM?

Is possible download a MPEG Dash content with DRM?
How can I decrypt using the MPD file?
I tried download all M4S segments (audio and video) but when I join the segments the video doesn't work properly.
The site is using Widevine platform for DRM.
I tried too youtube-dl and dash-proxy but again unsuccessfully.
I searched on Google but I didn't succeed.
No because it's not part of the browser. The browser implements EME which allows to 'offload' decoding a video to a 3rd party software.
When you download chrome, you download another compiled "CDM" app which does the decoding and is a 'black box'. So you'd need to modify that black box CDM, not the browser. So only option is then the screen capture.
MS has a system that even prevents screen capture software (since windows controls OS) Chrome desktop CDM has weaknesses but not in the league of 'youtube downloader'.
Also Google doesn't provide CDM for modified browsers.
A researcher on twitter a couple years ago claimed to defeat the encryption by directly cracking the encryption itself, based on knowledge of what the CDM was doing. At this point though, it's beyond 'look the other way' and you would definitely be in legal jeopardy if you distributed such information or content.
In the future, Google would like all of this to be done in hardware further making it hard to defeat. Eg once they got several hardware manufacturers to put a chip in their monitors, they might literally say "if you want to watch google play or netflix, you need an 'secure monitor' (you know, so people don't spy on you...) ".
It's basic economics. If you can't live without netflix, they will lock it down and make you pay for each view. If you're 'meh' they will make it 9.99 and reel you in. If you literally prefer some 'open source movie website where everythings free, though lame' They will just try to track your interests, for a better day when they can make something irresistible you will pay for.
At this point people are pretty 'addicted' so encryption chips are being put into monitors, motherboards, video cards, even cables connecting the monitor to computer. But if they squeeze too hard, people will just walk away. But their data models now would warn them if people were getting to that limit, so it's unlikely.
EDIT: today I came across a code repository which is a chrome extension that will tell you the decryption key as it decrypts a video. I won't post the link here (but it's currently at github publicly). It contains the private key that is used by the Google Widevine CDM to decrypt the keys (which are sent encrypted from the license server). So if you have access to watch a video (eg you rent a video at google play) then you can see the key, download the mp4, then use ffmpeg to decrypt the mp4 with that key that was reported while you played the video. You would then have an unencrypted video. This is why Google tells their content providers to only provide 'low quality' versions for desktop browsers, and reserve high quality (eg 4K) content for environments where decryption is happening in a hardware chip.
I am assuming you are asking how you can handle the DRM part and that the download part is ok, using dash-proxy or similar?
The way the DRM works with DASH streaming is that the player streaming the video will recognise from the manifest and/or the video stream that the video is encrypted when you try to play it and will ask the DRM license server for the license.
For widevine it requires the URL of the license server to be configured or input into the player - see the the example at Shaka player: https://shaka-player-demo.appspot.com and choose custom asset from the drop down list and you will see how you have to enter the License Server URL.
If you have downloaded the video then the player will still need to recognise that the video is encrypted, that the DRM system is widevine and will need to be told the license server to request the license from.
The player can recognise the content is encrypted from the MP4 PSSH box - a header which indicates it is encrypted and the DRM system being used, in your case Widevine.
If you don't have authorisation or the video was originally a live stream or if it had some time constraints you may not be granted a license. Similarly, if you are planing to watch it offline, then you will need to receive a persistent license (one that is valid on the device for some time) which may not be available for the video you want to watch.
If you have the key used for encrypting the content, You can try the dashdownloader script from github hosted in Drm-Dash-stream-downloader repository. It uses ffmpeg for aes-128 encrypted content and mp4decrypt from Bento tools SDK for other cipher suites.

API for manipulating audio output in windows 8

I want to manipulate audio output data, for all the different running applications, before it is sent to the speakers.
Turn the volume up or down, filter the audio, things like that.
How can I gain access to the audio output in real time?
Is there a way to not depend on the audio driver interface?
Thanks! :)
Windows Store apps allow you to use WASAPI. In WASAPI, there is a concept of "audio sessions", of which there is one for every stream of audio being sent to the soundcard. You can enumerate the audio sessions which give you access to IAudioSessionControl. However, this doesn't let you manipulate the audio, which as far as I know WASAPI simply doesn't allow. The best you can hope for is to get hold of ISimpleAudioVolume for each session, but last time I tried that, I found that you couldn't get hold of the session GUIDs you needed to adjust the volume for other processes. You may be able to get hold of the audio endpoints and adjust the master volume for the soundcard.
In short, WASAPI is the most powerful audio API for Windows Store apps but unfortunately I don't think it will let you do very much of what you are asking here.

What are some ways to stream audio from a CDN so that it can't be downloaded?

I'm looking for a way to stream audio from a CDN server so that the end-user can't download the audio without first signing up for a special account, but so that they can preview the (entire) audio prior to setting up an account.
What are the best technologies to do this with?
Thanks!
As #dykeag mentioned, what you are asking for is technically impossible to do completely, since one could always just record the audio output, either via an analog device or via a special audio driver.
However, there are various barriers in place to make this more difficult, though they all essentially rely on having a dedicated client program, encrypting the audio-stream that is being downloaded, and decrypting it in your client.

Audio hosting platform / Server-side software

I'm looking for somewhat for audio which is like Kewego or Dailymotion Cloud to video.
I'm looking for a good service to:
Encode user-uploaded audio files in predefined qualities
Stream it on demand in a more or less customisable player.
--
The goal is to run my own audio hosting platform, a bit like Soundcloud.
I'm open to all kinds of solutions, but I would prefer a cloud hosting with good API to interface it in a white label way. But if you know good server-side software, I could also use that...
Edit:
The bounty is now opened for 7 days and no answers: if you have any clues for me to achieve my platform, I'm interested...
API based encoder -> www.zencoder.com
Player -> If you are looking for something as robust as soundcloud, you are going to have to write that yourself. Otherwise something like jplayer could work. http://www.jplayer.org/latest/demos/
Home Baked -> A combination of FFMPEG + Wowza would give you a nice 1 - 2 punch for encoding / adaptive bitrate delivery. (Wowza doesn't support VOD transcoding with their "Transcode AddOn" yet, otherwise you would be able to use JUST wowza). They also have a deal with Amazon for daily instances if you just want to try it out.

Streaming audio to a browser

I have a large amount of audio stored on my web server in a very custom format that can't be replayed by anything other than my own application. That application is a Win32 app that can connect to my web server and stream and replay that audio.
I'd really like to be able to do the streaming and replaying from within a browser, but don't know where to start. Ideally I'd like the technology to be cross-platform (unlike my current Win32 app) and cross-browser (IE 6 and above and Firefox).
My current thoughts are to look at things like:
Flash, but doesn't that only replay mp3 audio?
Java, are VMs freely available still?
Converting the audio to a WAV file on the web server and then using someone else's plugin to replay that file. I'd rather keep the conversion off the web server for performance reasons, but is still an option.
Writing my own custom plugin to do the complete stream and replay operation.
Any guidance would be most useful.
Please note that the audio is not music and that simply converting to another audio format is not trivial. The audio that is stored also changes frequently (every minute) would need constant conversion.
Why are you using a proprietary music format? I'd probably not even bother downloading a program to listen to it.
I would suggest you convert it to mp3 and then use flash.
Building your own plugin would probably be hard, there are so many different platforms you'd have to cater for, something like flash is written for them already.
Apart from converting server-side: Implement a decoder for your format in ActionScript or Java. Then you can write a Flash movie or Java applet that plays it. Both languages/runtimes should be fast enough to decode in realtime unless your format is very complex. Flash would be the more accessible of the two, since nearly everyone has the plugin installed. (It's possible that playing a raw sound buffer isn't supported by older Flash versions than 10, I'm no expert on that.) The Java plugin is definitely free, but you'd require the users to install it.
I'd go with converting the audio to WAV (or MP3) on the server. Writing your own cross-platform browser component would be a lot of work, thanks to the different ways the major OSes handle their audio APIs.
Try taking a look at shoutcast.
Basically its a server app that will stream music to any client that connects to it through a browser (effectively your own radio station). I've never used it myself but should be straight forward.
Another idea is winamp remote. Again you install the app on the server but this time you can browse your music collection on their website and play individual songs.

Resources