Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to encrypt and decrypt a file with Qt/C++?

I want to create a program, which can encrypt and decrypt a complete file with an individual password. Is there any way to manage this in Qt and/or C++ and how?

like image 456
Berschi Avatar asked Aug 11 '09 18:08

Berschi


5 Answers

Qt doesn't provide functionality to encrypt/decrypt.

QCryptographicHash only generates hashes. It is not what you are looking for.

like image 106
Manjeet Dahiya Avatar answered Oct 30 '22 20:10

Manjeet Dahiya


I've never used it myself, but I've heard great things about QCA. It's cross platfrom, uses a Qt-style API and Qt datatypes.

like image 24
Parker Coates Avatar answered Nov 12 '22 10:11

Parker Coates


www.cryptopp.com is a very complete C++ library with implementations of most algorithms.

The actual program (select file, read, obtain key, encrypt etc) should be piece of cake.

like image 27
Kristoffon Avatar answered Nov 12 '22 10:11

Kristoffon


Old, I know, but try Botan. It's actually used internally by Qt Creator 2.0. If you download the Qt Creator 2.0 sources you can find a copy of Botan 1.8.8 all set up for the Qt build system (qmake).

like image 6
Jake Petroules Avatar answered Nov 12 '22 11:11

Jake Petroules


Neither Qt nor the C++ standard library have encryption built-in. You'll need another external library to handle encryption.

like image 5
John Calsbeek Avatar answered Nov 12 '22 10:11

John Calsbeek