1 /* $OSSEC, os_crypto/blowfish_op.c, v0.2, 2005/09/17, Daniel B. Cid$ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 2) as published by the FSF - Free Software
12 /* v0.2 (2005/09/17): uchar fixes
16 /* OS_crypto/blowfish Library.
17 * APIs for many crypto operations.
28 typedef unsigned char uchar;
30 int OS_BF_Str(char *input, char *output, char *charkey,
31 long size, short int action)
34 static unsigned char cbc_iv [8]={0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10};
37 memcpy(iv,cbc_iv,sizeof(iv));
39 BF_set_key(&key, strlen(charkey), (uchar *)charkey);
41 BF_cbc_encrypt((uchar *)input, (uchar *)output, size,