Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Encryption
QtWS25 Last Chance

Encryption

Scheduled Pinned Locked Moved General and Desktop
9 Posts 5 Posters 8.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nothere
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Darryl DSouza
      wrote on last edited by
      #2

      why not QCryptographicHash? May be hashing heps you than encrypt and decrypt.

      Darryl D'Souza

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nothere
        wrote on last edited by
        #3

        It is required to store encrypted password and decrypt it for server authentication.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Darryl DSouza
          wrote on last edited by
          #4

          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

          Darryl D'Souza

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nothere
            wrote on last edited by
            #5

            Sorry, but at first your link invalid and at second we on desktop.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nothere
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sinhngn
                wrote on last edited by
                #7

                Thank you!

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  Perhaps "this code":/wiki/Simple_encryption is useful for you?

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    movemove9
                    wrote on last edited by
                    #9

                    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();
                    }@

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved