source: lib/rc4.h @ 04026d4

Last change on this file since 04026d4 was 7ed3199, checked in by Wilmer van der Gaast <wilmer@…>, at 2006-06-25T14:07:01Z

Moved Base64-related functions to a separate file and added decode funtions.

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