0

I am making a program in Qt5.2.1 and in it I am using a text file to store some data. I would like to encrypt it and decrypt it inside the program and display the text stored in the file in a QPlainTextEdit ( or any other similar widget).

I searched and came across Qcryptographichash but i have no idea how to use it. I read somewhere that it does not provide a very secure encryption but that doesn't matter ( I am not expecting hackers to try and read this file).

So, could anyone guide me in the right direction, maybe even give me some code. :D

user121273
  • 59
  • 1
  • 2
  • 9
  • It is a hash algorithm, not encryption. You cannot get back the original data you hash it from. Google hash vs encryption for more info. – Rosdi Kasim Mar 12 '14 at 13:48

1 Answers1

0

QCryptographic hash creates a hash from given data. That is a one-way process, so the it will not do what you want, namely encrypt the data in a form that can be retrieved via decryption.

You can read more about the difference between encryption and hashes here.

You need to research into possible encryption algorithms. To my knowledge, that's not something that is part of Qt.

It's a large area of on-going research; there are so many to choose from, as you can see here.

Community
  • 1
  • 1
TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85