1

I have an encryption app that just encrypts a string and then can decrypt also.. But how can I make it so the user sets a password and the other person has to put in that password to decrypt the message.

1 Answer 1

0

Based on the tags in your question ( & ), I assume you intend on using the Qt framework. Thankfully, there is a library available for Qt that can do this for you. And the best part is that the library is already included in the main archives.

The library I'm referring to is called QCA - Qt Cryptographic Architecture and is available through the libqca2 Install libqca2 and libqca2-dev Install libqca2-dev packages. You will also want to install the libqca2-plugin-ossl Install libqca2-plugin-ossl package, which provides runtime support for the OpenSSL functions.

Note: before going any further, I should point out that QCA is only available for Qt 4.x at the time of writing and may not work with Qt 5.x.

Rather than going into a lot of detail on using the QCA library, I will instead point you to this example which demonstrates how to use the AES128 algorithm to securely encrypt a message with a passphrase and then decrypt it later with the same passphrase.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .