source: lib/rc4.h @ df1694b

Last change on this file since df1694b was df1694b, checked in by Wilmer van der Gaast <wilmer@…>, at 2006-06-25T12:15:42Z

Moving all generic files to lib/ instead of having some in / and some in
protocols/, and adding RC4 code.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/***************************************************************************\
2*                                                                           *
3*  BitlBee - An IRC to IM gateway                                           *
4*  Simple (but secure) RC4 implementation for safer password storage.       *
5*                                                                           *
6*  Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net>                   *
7*                                                                           *
8*                                                                           *
9*  This program is free software; you can redistribute it and/or modify     *
10*  it under the terms of the GNU General Public License as published by     *
11*  the Free Software Foundation; either version 2 of the License, or        *
12*  (at your option) any later version.                                      *
13*                                                                           *
14*  This program is distributed in the hope that it will be useful,          *
15*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
16*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
17*  GNU General Public License for more details.                             *
18*                                                                           *
19*  You should have received a copy of the GNU General Public License along  *
20*  with this program; if not, write to the Free Software Foundation, Inc.,  *
21*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.              *
22*                                                                           *
23\***************************************************************************/
24
25
26struct rc4_state
27{
28        unsigned char S[256];
29        unsigned char i, j;
30};
31
32struct rc4_state *rc4_keymaker( unsigned char *key, int kl, int cycles );
33unsigned char rc4_getbyte( struct rc4_state *st );
34int rc4_encode( unsigned char *clear, int clear_len, unsigned char **crypt, char *password );
35int rc4_decode( unsigned char *crypt, int crypt_len, unsigned char **clear, char *password );
Note: See TracBrowser for help on using the repository browser.