Were you able to compile the crypto+ library successfully by changing
fipstest.h file and have got the ".a" and ".dll" file

place them in right folders (bin , lib )

you might have missed one step or placed the files , please follow it
correctly if you havent compiled successfully
the full compilation takes around 4 to 5 minutes and around 180 mb of
data is created in which ddll's are created

make sure to add the support in "pro file" and also add this header



#define CRYPTOPP_DEFAULT_NO_DLL
#include <cryptopp/dll.h>
#ifdef CRYPTOPP_WIN32_AVAILABLE
#include <windows.h>
#endif
#include <cryptopp/md5.h>

USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
const int MAX_PHRASE_LENGTH=250;


Then please try to run this code in qt console by creating empty file
and not qt console default

#include <iostream>

#define CRYPTOPP_DEFAULT_NO_DLL
#include <cryptopp/dll.h>
#ifdef CRYPTOPP_WIN32_AVAILABLE
#include <windows.h>
#endif
#include <cryptopp/md5.h>

USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
const int MAX_PHRASE_LENGTH=250;

int main(int argc, char *argv[]) {

CryptoPP::MD5 hash;
byte digest[ CryptoPP::MD5::DIGESTSIZE ];
std::string message = "Hello World!";

hash.CalculateDigest( digest, (const byte*)message.c_str(),
message.length());

CryptoPP::HexEncoder encoder;
std::string output;
encoder.Attach( new CryptoPP::StringSink( output ) );
encoder.Put( digest, sizeof(digest) );
encoder.MessageEnd();

std::cout << "Input string: " << message << std::endl;
std::cout << "MD5: " << output << std::endl;

return 0;
}

remember that you should add these lines to its .pro file before
starting to build it:
LIBS += -lcryptopp552
CONFIG+=console


on the same tutorial page downloads are given try running those if
those fails refer t o other members


On Sep 12, 4:14 pm, anno <[email protected]> wrote:
> I did it exactly like in this thread described.
>
> I compiled the lib and included it to my project.
>
> After this I added the following code:
>
> #include <cryptopp/md5.h>
>
> CryptoPP::MD5 hash;
>         byte digest[ CryptoPP::MD5::DIGESTSIZE ];
>         std::string message = "abcdefghijklmnopqrstuvwxyz";
>
>         hash.CalculateDigest( digest, (const byte*)message.c_str(),
> message.length() );
>
>         CryptoPP::HexEncoder encoder;
>         std::string output;
>         encoder.Attach( new CryptoPP::StringSink( output ) );
>         encoder.Put( digest, sizeof(digest) );
>         encoder.MessageEnd();
>
> But some error are displayed:
>
> include/cryptopp/algparam.h: In constructor
> 'CryptoPP::ConstByteArrayParameter::ConstByteArrayParameter(const T&,
> bool) [with T = std::basic_string<char, std::char_traits<char>,
> std::allocator<char> >]':
> include/cryptopp/filters.h:744: instantiated from here
> include/cryptopp/algparam.h:26: warning: unused variable
> 'cryptopp_assert_26'

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to