Results 1 to 4 of 4

Thread: how to use a hashed password as a private key for data encryption/decryption in Qt?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2020
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default how to use a hashed password as a private key for data encryption/decryption in Qt?

    I'm sure I'm not the first to ask something like this, but I haven't been able to find anything useful so I'm posting this to get your help, thank you.

    I'm trying to create an app to store some user data. I'm using sqlite to keep track of everything. The idea is that a user can create their own login. The login password will be hashed and the cipher kept in the db. The user should be able to use that hashed password as a private key to encrypt/decrypt other data they enter into the app. The data is stored locally on their computer so I don't want anyone to just open up the db and view all the user's info that's why I need to encrypt/decrypt that data during run time. I don't know how to write something like this. Can anyone give me some suggestions on where to start. I can't find any Qt class that would allow for encryption/decryption during run time. For the hash I was thinking of using QCryptographicHash, but can't figure out how to properly do that with a password. Would anyone mind showing me what the syntax for that would be? Do I need to import any libraries or should I be using only the qt functions? Anyway, I would really appreciate any help with this because it's the part I'm stuck on and can't finish my app without this feature.

    Also, the encryption needs to be strong enough to store sensitive data like social security numbers or credit card numbers.

    Edit: I'm aware that this isn't very secure, but for now I just need to have the password hashed and the data encrypted. I'm going to work on making it more secure later like adding 2 factor authorization.
    Last edited by Pachuca; 8th February 2020 at 18:11.

Similar Threads

  1. [HELP] AES CBC & ECB Encryption & Decryption
    By nemoryoliver in forum Qt Programming
    Replies: 1
    Last Post: 12th February 2014, 07:28
  2. Replies: 1
    Last Post: 21st May 2011, 09:26
  3. AES Encryption Decryption of a file using Qt
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 7th December 2010, 13:22
  4. Encryption and decryption
    By vermarajeev in forum General Programming
    Replies: 5
    Last Post: 27th August 2007, 21:17
  5. Basics of Encryption and decryption
    By vermarajeev in forum General Discussion
    Replies: 4
    Last Post: 26th April 2007, 11:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.