Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Encrypt / Decrypt video files to play only in my custom made video player
Forum Updated to NodeBB v4.3 + New Features

Encrypt / Decrypt video files to play only in my custom made video player

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 4.1k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on last edited by
    #1

    I want to encrypt video files and make custom video player. Only my custom made video player can decrypt and play encrypted video files. I am using QMediaplayer. I will use most of the functionality from QMediaPlayer. I just to want to encrypt and decrypt using custom player.

    Please give some hint or link.

    A 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What kind of video do you have in mind ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      mit_cruzeM 1 Reply Last reply
      0
      • mit_cruzeM mit_cruze

        I want to encrypt video files and make custom video player. Only my custom made video player can decrypt and play encrypted video files. I am using QMediaplayer. I will use most of the functionality from QMediaPlayer. I just to want to encrypt and decrypt using custom player.

        Please give some hint or link.

        A Offline
        A Offline
        ambershark
        wrote on last edited by ambershark
        #3

        @mit_cruze How secure do you want it? You can use PKE style encryption or even a regular symmetric algorithm. Both of those would be hackable given enough time and desire though.

        There are ways to obfuscate the keys since the video player will need to know them, but it's impossible to completely prevent hacking with keys stored locally.

        To really secure it you will need to use a key server to help you get keys to decrypt. Still crackable but much much harder.

        So really if you just want some simple encryption google "code for blowfish encryption c++" or whatever algorithm you prefer.

        Keep in mind you'll need secure memory for your process or when you decrypt your video to play it, someone can grab it. Also you can't cache it to disk at all during decryption which means you may need a large amount of memory for your video player.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        mit_cruzeM 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          What kind of video do you have in mind ?

          mit_cruzeM Offline
          mit_cruzeM Offline
          mit_cruze
          wrote on last edited by
          #4

          @SGaist It is in mjpeg format. It is live streaming.

          1 Reply Last reply
          0
          • A ambershark

            @mit_cruze How secure do you want it? You can use PKE style encryption or even a regular symmetric algorithm. Both of those would be hackable given enough time and desire though.

            There are ways to obfuscate the keys since the video player will need to know them, but it's impossible to completely prevent hacking with keys stored locally.

            To really secure it you will need to use a key server to help you get keys to decrypt. Still crackable but much much harder.

            So really if you just want some simple encryption google "code for blowfish encryption c++" or whatever algorithm you prefer.

            Keep in mind you'll need secure memory for your process or when you decrypt your video to play it, someone can grab it. Also you can't cache it to disk at all during decryption which means you may need a large amount of memory for your video player.

            mit_cruzeM Offline
            mit_cruzeM Offline
            mit_cruze
            wrote on last edited by
            #5

            @ambershark May I have some links or reference of PKE style encryption or even a regular symmetric algorithm?

            A 1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              In that case shouldn't you rather setup the encryption at the stream level rather than the video ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • mit_cruzeM mit_cruze

                @ambershark May I have some links or reference of PKE style encryption or even a regular symmetric algorithm?

                A Offline
                A Offline
                ambershark
                wrote on last edited by
                #7

                @mit_cruze said in Encrypt / Decrypt video files to play only in my custom made video player:

                @ambershark May I have some links or reference of PKE style encryption or even a regular symmetric algorithm?

                Good news is if you are streaming you can indeed encrypt the stream as @SGaist suggested. And you can keep your keys much more secure since they do not need to be stored client side.

                As for links, you can easily find code implementation in google. Some of Bruce Schneier's algorithms are awesome, blowfish, twofish, etc. Check out his website. I posted a link directly to his blowfish code. You may want to look around for other implementations though. His math and encryption/security skills are top notch but his coding is kinda scary, lol. At a bare minimum you'll want to make easy to use classes to wrap the underlying code.

                http://www.schneier.com/code/bfsh-sch.zip

                As for PKE, there are tons of algorithms there too. It's a complex topic and one that you really shouldn't try to implement yourself without a really strong math background. I would recommend using a library or binary for encryption written by someone who really knows what they are doing. If you want to do it yourself, I recommend bruce schneier's applied cryptography book.

                Here is a link to an API that might be worth looking into (Disclaimer: I've never used it, and don't know how good/secure it is):

                https://www.cs.auckland.ac.nz/~pgut001/cryptlib/

                There's tons out there, just google public/private key encryption algorithms.

                My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved