how to password protect a folder or mp4 flash file with


  • hi,

    i'm using the windows media player in my application to play some mp4 files.

    i certainly want to use only mp4 files.

    i want to password protect those files, i.e if someone will try to open those files it will ask a password.

    additionally i want that only my application could be able to play them, i.e only my application will know the password and would be able to play them.

    those password protect mp4 files should have the ability to be copied and paste etc.

    i tried to find a source code and also tried to find a package that fits to, but no luck. 

    l also tried to find some classes under the namespace and i found some Encryption classes, but when i encrypt a mp4 file, it will not work after decryption.

    additionally i don't want to use the winzip password protect, because when my application will unzip it, the user will be able to search for the file and copy it.

    i also tried to use an example from codeproject that password protect files by using a registry key, i am guessing when i will delete it the file will be accessable again, so that option is not good either.

    can someone help me to find a solution to my problem?




    Wednesday, April 06, 2011 12:59 AM

All replies

  • The only DRM protection Windows Media Player supports is Windows Media DRM, which is not password-based. This limitation does not apply if you write your own video player and video formats. You may want to find a forum more closer to Windows Media Digital Right Mangement SDK development if you are interested in Windows Media DRM. There is no password protection feature in Windows Explorer, so there is no Windows API for third-party programs.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Wednesday, April 06, 2011 3:07 AM
  • hello Sheng Jiang,

    thank you for this information about the DRM.

    i did not mentioned another thing in my first question, and that is that i want also to disable a screen recording ability by the user.

    in that case are you sure that windows DRM is the right solution to my problem? 

    because if someone will have my mp4 file that has a DRM restrictions, and i will give him a licence to it, he will be able to watch that video with windows media player regardless my application, and screen record it.

    if i could give a DRM licence to a user that works only in my application, i guess that i could shut down the screen recorder programs while the video is playing (using windows API i think). am i right? and is it possible to do this with the windows media DRM?



    Wednesday, April 06, 2011 9:48 AM
  • Hello Moshik,

    Please have a look these links:

                    File.Encrypt Method (System.IO)

                    File.encrypt method


    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 08, 2011 3:19 AM