Encryption
-
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); -
why not QCryptographicHash? May be hashing heps you than encrypt and decrypt.
-
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
-
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.
-
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();
}@