Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. implementing 3 dimensional array (or other technique)
Forum Updated to NodeBB v4.3 + New Features

implementing 3 dimensional array (or other technique)

Scheduled Pinned Locked Moved Unsolved Brainstorm
4 Posts 2 Posters 1.8k Views 2 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    This is strictly a coding exercise, with the goal being clarity and ease of use.

    The app I'm working on uses a TLS-esque credential technique. A credential set consists of (all binary):

    1. 32-byte authentication key
    2. 32-byte encryption key
    3. 100-byte username
    4. 100-byte passphrase

    There are 3 levels of credentials: manufacturing, application, and operational.

    The application must support a small number of customers, each with their own credentials.

    My first thought was to create a structure to hold the 4 arrays needed above (using QByteArray), and have a two-dimensional vector of these structures. But, as multidimensional vectors, whether in C++ or Qt, tend to get cumbersome to code. Also, it's probably good practice not to distribute one customer's authentication data to another customer, even though it's well hidden in the binary file.

    I guess another way to do this would be to furnish a plugin that supplied the credential set for the customer in question. This would eliminate the need for the application to contain credentials for multiple customers. Or is this overkill?

    I appreciate any feedback.

    K 1 Reply Last reply
    0
    • mzimmersM mzimmers

      Hi all -

      This is strictly a coding exercise, with the goal being clarity and ease of use.

      The app I'm working on uses a TLS-esque credential technique. A credential set consists of (all binary):

      1. 32-byte authentication key
      2. 32-byte encryption key
      3. 100-byte username
      4. 100-byte passphrase

      There are 3 levels of credentials: manufacturing, application, and operational.

      The application must support a small number of customers, each with their own credentials.

      My first thought was to create a structure to hold the 4 arrays needed above (using QByteArray), and have a two-dimensional vector of these structures. But, as multidimensional vectors, whether in C++ or Qt, tend to get cumbersome to code. Also, it's probably good practice not to distribute one customer's authentication data to another customer, even though it's well hidden in the binary file.

      I guess another way to do this would be to furnish a plugin that supplied the credential set for the customer in question. This would eliminate the need for the application to contain credentials for multiple customers. Or is this overkill?

      I appreciate any feedback.

      K Offline
      K Offline
      Konstantin Tokarev
      wrote on last edited by
      #2

      @mzimmers said in implementing 3 dimensional array (or other technique):

      Also, it's probably good practice not to distribute one customer's authentication data to another customer, even though it's well hidden in the binary file.

      Really? Unless you take special care to obfuscate your data you may safely assume it is passed as a clear text.

      Just read data from file (maybe rcc binary resource file; data may be encrypted if it makes you feel safer, but actually it's nothing more than obfuscation), and attach unique file to each customer's copy

      mzimmersM 1 Reply Last reply
      1
      • K Konstantin Tokarev

        @mzimmers said in implementing 3 dimensional array (or other technique):

        Also, it's probably good practice not to distribute one customer's authentication data to another customer, even though it's well hidden in the binary file.

        Really? Unless you take special care to obfuscate your data you may safely assume it is passed as a clear text.

        Just read data from file (maybe rcc binary resource file; data may be encrypted if it makes you feel safer, but actually it's nothing more than obfuscation), and attach unique file to each customer's copy

        mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        @Konstantin-Tokarev if I use a resource file, don't I have to re-build the binary whenever I change which customer's file I want to use?

        K 1 Reply Last reply
        0
        • mzimmersM mzimmers

          @Konstantin-Tokarev if I use a resource file, don't I have to re-build the binary whenever I change which customer's file I want to use?

          K Offline
          K Offline
          Konstantin Tokarev
          wrote on last edited by Konstantin Tokarev
          #4

          @mzimmers Yes, you don't have to

          1 Reply Last reply
          1

          • Login

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