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. Using QCryptographicHash in qt c++

Using QCryptographicHash in qt c++

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 926 Views
  • 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.
  • T Offline
    T Offline
    TheCeylann
    wrote on last edited by
    #1

    I have a string that I write and read inside the text file. I want to encrypt this strig. Do I have to use the QCryptographicHash library for this? If I need to use QCryptographicHash can you give me an example of that?

    JonBJ 1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      QCryptographicHash is just for hashing (MD5, SHA1...), not for encrypting / decrypting.
      You can use it if you don't need to decrypt the string.

      1 Reply Last reply
      3
      • T TheCeylann

        I have a string that I write and read inside the text file. I want to encrypt this strig. Do I have to use the QCryptographicHash library for this? If I need to use QCryptographicHash can you give me an example of that?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @TheCeylann
        As @Bonnie has said, you cannot use QCryptographicHash if you really need to decrypt at a later date. It is for one-way, asymmetric encryption: it can be used to check that the user supplies the same encryption password at a later date as they did when originally encrypting the string, but can never retrieve the original, plain-text string.

        If you need to be able to get the original plain-text back at a later date you must use a two-way, symmetric encryption algorithm, which is not "secure". Qt does not pre-supply such code. An example of such an algorithm, which can be used easily with Qt, is given in Simple encryption with SimpleCrypt.

        1 Reply Last reply
        2

        • Login

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