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. Best options for using bulk encryption (AES 128 / 256 CBC) and crossplatform development?
Forum Updated to NodeBB v4.3 + New Features

Best options for using bulk encryption (AES 128 / 256 CBC) and crossplatform development?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 7.0k Views 1 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.
  • rootshellR Offline
    rootshellR Offline
    rootshell
    wrote on last edited by
    #1

    Hello everyone,

    I am working on my first major cross platform application, and naturally using Qt was a no-brainer.

    The application will be an "agent" that will run as a service on windows, linux and mac.
    The agent will sit there collecting metrics and running various automated tasks, until the "client" connects to it and gathers the data that the agent collected along with logs, etc etc.

    I want to make sure the communications between the client and the agent are secure, SSL would be an obvious choice but I would really rather stay away from certificates (additional hassle) and use AES 128 or preferably AES 256...which will also be used for file encryption.

    Wondering if anyone has some experience in this area and can point me in the right direction?

    I have used Botan (my video on the subject http://youtu.be/EIcysZtl8AE) for simple applications, but have read about OpenSSL with the "Qt Cryptographic Architecture" (http://delta.affinix.com/qca/), wondering if anyone knows the pros and cons of each? Are there better options?

    Basically I am looking for something with a small learning curve that runs anywhere Qt runs, and does not have a huge footprint.

    ANY advice and guidance will be much appreciated!

    Bryan

    Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

    Languages: C++, C#, VB, Python, Java

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Both are good, but encrypting the data is not enough here I think.

      You will need to do key exchange, etc. or security will be seriously flawed (e.g. by having the key shipped in the binary). Yes, that is exactly the the hassle you want to stay away from;-)

      1 Reply Last reply
      0
      • rootshellR Offline
        rootshellR Offline
        rootshell
        wrote on last edited by
        #3

        I hear you :)

        Any pointers or direction on getting started with OpenSSL?

        Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

        Languages: C++, C#, VB, Python, Java

        1 Reply Last reply
        0
        • B Offline
          B Offline
          balagopal
          wrote on last edited by
          #4

          Hi,
          Iam using QCA library to encrypt and decrypt a mp4 file.Below is the code which i used.
          But some how my decrypted file is corrupt and VLC cannot play this file.

          VLC Output
          [loas @ 0xb26150c0] Stream #0: not enough frames to estimate rate; consider increasing probesize
          [loas @ 0xb26150c0] decoding for stream 0 failed
          [loas @ 0xb26150c0] Could not find codec parameters (Audio: aac_latm, 0 channels, s16)
          [loas @ 0xb26150c0] Estimating duration from bitrate, this may be inaccurate

          Mycode:
          @QCA::Initializer init = QCA::Initializer() ;
          if(QCA::isSupported("aes128-cbc-pkcs7"))
          {
          QFile inputFile("/home/Bala/sample.mp4");

          if (!inputFile.open(QIODevice::ReadOnly))
          qDebug() << "problem while reading " ;

           QByteArray InputFileByteArray = inputFile.readAll();
           inputFile.close();
           qDebug() << "size of clear file " <&lt; InputFileByteArray.size();
           QCA::SecureArray inputSA = InputFileByteArray;
               qDebug() &lt;&lt; "size of inputSA" <&lt; inputSA.size();
           QString ki = "myencryp";
           QCA::SymmetricKey key = ki.toAscii();
           QCA::InitializationVector iv = ki.toAscii();
          

          QCA::Cipher cipher(QString("aes128"),QCA::Cipher::CBC, QCA::Cipher::DefaultPadding,QCA::Encode,key,iv);

          QCA::SecureArray encoded = cipher.process(inputSA);
          qDebug() << "size of encoded" << encoded.size();
          if (!cipher.ok()) {
          printf("update failed\n");
          }
          cipher.setup(QCA::Decode, key, iv);
          QCA::SecureArray original = cipher.process(encoded);
          qDebug() << "size of original" << original.size();
          if (!cipher.ok()) {
          printf("Final failed\n");
          }

          QByteArray originaldata = original.toByteArray();
          

          qDebug() << "size of originaldata" << originaldata.size();
          QFile file1("/home/Bala/sample_decoded.mp4");
          if (!file1.open(QIODevice::WriteOnly))
          qDebug() << "problem while writing ";
          QDataStream out1(&file1);
          out1<< originaldata;
          file1.close();

          }@

          Please let me know if there are any issues with my code.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on last edited by
            #5

            belagopal: Please do not hijack other people's threads!

            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