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