Using QCryptographicHash in qt c++
-
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?
-
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?
@TheCeylann
As @Bonnie has said, you cannot useQCryptographicHash
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.