Encryption
-
wrote on 16 Feb 2011, 15:55 last edited by
Hi there.
The question is about string encryption and decryption? Some like QCA is too big to use. Have you ever seen anything to work AES or 3DES over OpenSSL?
Just couple of methods like this:
QString encrypt(const QString &data, const QString &key);
QString decrypt(const QString &data, const QString &key); -
wrote on 16 Feb 2011, 16:14 last edited by
why not QCryptographicHash? May be hashing heps you than encrypt and decrypt.
-
wrote on 16 Feb 2011, 16:16 last edited by
It is required to store encrypted password and decrypt it for server authentication.
-
wrote on 16 Feb 2011, 16:42 last edited by
Ok. Then QCryptographicHash wil not hep as far as i know, since it can ony work one way...On symbian, use can use the native interfaces http://wiki.forum.nokia.com/index.ph...ptography_APIs
-
wrote on 16 Feb 2011, 16:52 last edited by
Sorry, but at first your link invalid and at second we on desktop.
-
wrote on 16 Feb 2011, 18:18 last edited by
Ok, now we have something like "this":http://ompldr.org/vN2cxdg/aes.tar.bz2 for AES, but with unknown license. I remake it from "this":http://www.softwarematrix.cn/blog/misc/using-openssl-in-cpp.
-
wrote on 3 Apr 2012, 10:19 last edited by
Thank you!
-
wrote on 3 Apr 2012, 10:33 last edited by
Perhaps "this code":/wiki/Simple_encryption is useful for you?
-
wrote on 6 May 2014, 04:15 last edited by
I use "Botan":https://github.com/randombit/botan for Encryption, please see my "blog post":http://onethingor2.blogspot.tw/search/label/Botan on how to compile botan to an library.
One the library is compiled, includes the lib and header. Then code would look like this.
@QString hash = QString("PRIVATE_KEY") + QString("PUBLIC_KEY");
const bool ok = Botan::check_bcrypt(hash.toStdString(), "$2a$10$.POxJepIUGgMNR/wqgdjOuEd2sz9ag5Qo84/U7lpMceXVktsaXGZ2");
qDebug() << "Is KEY OK ?" << ok;@Or Something like this for DES Encryption
@SecureVector<byte> encrypt(const byte* msg, const SymmetricKey& key) {
Pipe pipe(get_cipher("DES/CBC", key, ENCRYPTION));
pipe.start_msg();
pipe.write(msg, strlen((const char*) msg));
pipe.end_msg();
return pipe.read_all();
}std::string decrypt(const SecureVector<byte>& msg, const SymmetricKey& key) {
Pipe pipe(get_cipher("DES/CBC", key, DECRYPTION));
pipe.start_msg();
pipe.write(msg);
pipe.end_msg();
return pipe.read_all_as_string();
}@