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

2019-01-22 09:27发布

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?

5条回答
我命由我不由天
2楼-- · 2019-01-22 09:48

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

查看更多
做个烂人
3楼-- · 2019-01-22 09:50

Qt doesn't provide functionality to encrypt/decrypt.

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

查看更多
【Aperson】
4楼-- · 2019-01-22 09:54

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).

查看更多
太酷不给撩
5楼-- · 2019-01-22 10:01

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.

查看更多
▲ chillily
6楼-- · 2019-01-22 10:02

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.

查看更多
登录 后发表回答