Qt Cryptographic Hashing
I been trying to use the Qt Encryption libraries and have been having trouble.
The ones that ship with Qt (QCryptographicHash) work well but only support
hash schemes that are insecure like md5 and SHA1, there is no SHA256 for example.

I found the Qt Cryptographic Architecture (QCA) which has much more features.
I got the libraries from the Delta XMPP Project site. http://delta.affinix.com/qca/

The link to the QCA library is http://delta.affinix.com/download/qca/2.0/qca-2.0.3.tar.bz2

It is the newest version of the QCA Libary.

The instruction are as follows.

> Installing QCA
> --------------
> 
> QCA requires Qt 4.2 or greater.
> 
> For Windows:
> ------------
> configure   
> nmake (or make)   
> installwin

Using newest Qt everything. Everything works great in Qt except this library.
I use Windows XP.
I followed the installation instructions and got no errors.

The problem is that I get errors when I try to use any code that has anything to do with the QCA library.  I would really appreciate any help getting this lib to work.

**Here is my code.**

The project file.

    #-------------------------------------------------
    #
    # Project created by QtCreator 2011-11-14T14:23:21
    #
    #-------------------------------------------------
    
    QT       += core
    QT       -= gui
    
    TARGET = kde_crypto2
    CONFIG   += console
    CONFIG   -= app_bundle
    CONFIG   += crypto
    
    TEMPLATE = app
    
    SOURCES += main.cpp


The source file.

    #include <QtCore/QCoreApplication>
    #include <QTextStream>
    #include <QString>
    #include <QtCrypto/QtCrypto>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        QTextStream t(stdout);
    
        if(!QCA::isSupported("sha1"))
            t << "SHA1 not supported!\n";
        else
        {
            QByteArray fillerString;
            fillerString.fill('a', 1000);
    
            QCA::Hash shaHash("sha1");
            for (int i=0; i<1000; i++)
                shaHash.update(fillerString);
            QByteArray hashResult = shaHash.final();
            if ( "34aa973cd4c4daa4f61eeb2bdbad27316534016f" == QCA::arrayToHex(hashResult) )
            {
                t << "big SHA1 is OK\n";
            }
            else
            {
                t << "big SHA1 failed\n";
            }
        }
    
        return a.exec();
    }




Qt Cryptographic Hashing
===

I been trying to use the Qt Encryption libraries and have been having trouble.
The ones that ship with Qt (QCryptographicHash) work well but only support
hash schemes that are insecure like md5 and SHA1, there is no SHA256 for example.

I found the Qt Cryptographic Architecture (QCA) which has much more features.
I got the libraries from the Delta XMPP Project site. http://delta.affinix.com/qca/

The link to the QCA library is http://delta.affinix.com/download/qca/2.0/qca-2.0.3.tar.bz2

It is the newest version of the QCA Libary.

The instruction are as follows.

> Installing QCA
> --------------
> 
> QCA requires Qt 4.2 or greater.
> 
> For Windows:
> ------------
> configure   
> nmake (or make)   
> installwin

Using newest Qt everything. Everything works great in Qt except this library.
I use Windows XP.
I followed the installation instructions and got no errors.

The problem is that I get errors when I try to use any code that has anything to do with the QCA library.  I would really appreciate any help getting this lib to work.

**Here is my code.**

The project file.

    #-------------------------------------------------
    #
    # Project created by QtCreator 2011-11-14T14:23:21
    #
    #-------------------------------------------------
    
    QT       += core
    QT       -= gui
    
    TARGET = kde_crypto2
    CONFIG   += console
    CONFIG   -= app_bundle
    CONFIG   += crypto
    
    TEMPLATE = app
    
    SOURCES += main.cpp


The source file.

    #include <QtCore/QCoreApplication>
    #include <QTextStream>
    #include <QString>
    #include <QtCrypto/QtCrypto>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        QTextStream t(stdout);
    
        if(!QCA::isSupported("sha1"))
            t << "SHA1 not supported!\n";
        else
        {
            QByteArray fillerString;
            fillerString.fill('a', 1000);
    
            QCA::Hash shaHash("sha1");
            for (int i=0; i<1000; i++)
                shaHash.update(fillerString);
            QByteArray hashResult = shaHash.final();
            if ( "34aa973cd4c4daa4f61eeb2bdbad27316534016f" == QCA::arrayToHex(hashResult) )
            {
                t << "big SHA1 is OK\n";
            }
            else
            {
                t << "big SHA1 failed\n";
            }
        }
    
        return a.exec();
    }



