Blowfish project

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
eze

Blowfish project

Post by eze » 08 Jan 2009, 13:28

 Posted by:  eze 

hello

I downloaded OpenSSL for Windows
(http://www.devside.net/guides/windows/openssl) because I want to use the
crypto function. Mainly Blowfish (BF). When I installed the project I took
the libeay32.dll file cointaining the methods.
To know the ordinal number and other things I'm using DLL export viewer. The
methods name are:

Code: Select all

 void BF_set_key(BF_KEY *key, int len, const unsigned char *data);

 void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,         BF_KEY *key, int enc);
 void BF_cbc_encrypt(const unsigned char *in, unsigned char *out,         long length, BF_KEY *schedule, unsigned char *ivec, int enc);
 void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,         long length, BF_KEY *schedule, unsigned char *ivec, int *num,         int enc);
 void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,         long length, BF_KEY *schedule, unsigned char *ivec, int *num);
 const char *BF_options(void);

 void BF_encrypt(BF_LONG *data,const BF_KEY *key);
 void BF_decrypt(BF_LONG *data,const BF_KEY *key);
You can check this in http://www.openssl.org/docs/crypto/blowfish.html#NAME

My problem is I don't know how to set the methods or functions. For instance
the function BF_set_key(BF_KEY *key, int len, const unsigned char *data) the
first parameter is a struct anyway anyone can test it or explain how it's
works.

I only have to use BF_set_key, BF_encrypt and BF_decrypt the are not
mandatory. I will appreciate your help.

Code: Select all

#define BF_LONG unsigned long
#define BF_ROUNDS       16
#define BF_BLOCK        8

typedef struct bf_key_st

        {BF_LONG P[BF_ROUNDS+2];
         BF_LONG S[4*256];
        } BF_KEY;

void BF_encrypt(BF_LONG *data,const BF_KEY *key);
void BF_decrypt(BF_LONG *data,const BF_KEY *key);
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);

BF_LONG == unsigned long

struct

{
        unsigned long P[18];
        unsigned long S[1024];
} BF_KEY;
Best Regards.
You do not have the required permissions to view the files attached to this post.

Mike

Re: Blowfish project

Post by Mike » 21 Jan 2009, 15:06

 Posted by:  Mike 

Why dont you simply download the blowfish algorithm and make a C dll from it and then call that dll?
It is way easier to use then. Fiddling with openssl is too cumbersome. Apart from that there is yassl and the crypto32.dll (freeware) as well..

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests