qutecom 一个开源的voip客户端
asterisk 开源的ippbx
rc4加密算法简单,快速,据说是比DES算法快10倍。sip 信令本身就属于明文方式传输的,之所以要加密,是为了防止运营商的干扰,使用一个弱的加密算法,是要能防止串改就满足要求了。
rc4 算法可以google原来,用密钥来生成一个256长度的box, 然后box与明文异或操作得到密文,密文再次异或就恢复明文。
下面实现了 qutecom 到asterisk 信令的当向加密,反向的目前还没弄完,等完工了在来补充。
rc4.h
/*
*RC4 functions for HTMLDOC.
*
* Original code by Rob Earhart
* Copyright 1999 by Carnegie Mellon University, All Rights Reserved
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of Carnegie Mellon
* University not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission.
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR
* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _RC4_H_
# define _RC4_H_
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* RC4 context...
*/
type