diff -Naur busybox-1.7.2/libbb/Kbuild busybox-1.7.2_new/libbb/Kbuild
--- busybox-1.7.2/libbb/Kbuild	2007-09-03 04:48:41.000000000 -0700
+++ busybox-1.7.2_new/libbb/Kbuild	2007-11-11 05:09:31.000000000 -0800
@@ -112,6 +112,7 @@
 lib-$(CONFIG_DF) += find_mount_point.o
 lib-$(CONFIG_MKFS_MINIX) += find_mount_point.o
 lib-$(CONFIG_SELINUX) += selinux_common.o
+lib-$(CONFIG_FEATURE_REMOTE_LOG) += syscrypt_api.o
 
 # We shouldn't build xregcomp.c if we don't need it - this ensures we don't
 # require regex.h to be in the include dir even if we don't need it thereby
diff -Naur busybox-1.7.2/libbb/syscrypt_api.c busybox-1.7.2_new/libbb/syscrypt_api.c
--- busybox-1.7.2/libbb/syscrypt_api.c	1969-12-31 16:00:00.000000000 -0800
+++ busybox-1.7.2_new/libbb/syscrypt_api.c	2007-11-11 05:09:31.000000000 -0800
@@ -0,0 +1,219 @@
+/* ====================================================================
+*
+*                      Copyright (c) 2006 Ooma Inc.
+*                      Proprietary and confidential
+*                      All rights reserved
+* 
+*                      file name       : syscrypt.c
+*                      date            : 5/21/2007
+*
+* 
+* ====================================================================
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <string.h>
+#include <syscrypt_api.h>
+#include <openssl/aes.h>
+
+#define MAX_DECRYPT_KEYS	1000000
+#define MAX_ENCRYPT_KEYS	500
+
+typedef struct syslog_crypto_key_s {
+	int index;
+	AES_KEY crypto_key;
+} syslog_crypto_key_t;
+
+syslog_crypto_key_t * g_encrypt_keys = 0;
+syslog_crypto_key_t * g_decrypt_keys = 0;
+int g_num_encrypt_keys;
+int g_num_decrypt_keys;
+
+/* read the key file, format is very strict, index, 6 characters, with zero padding, followed by comma and then the 64 character hex key, no spaces allowed */
+
+int syscrypt_read_keys(const char * key_file, int max_keys, syslog_crypto_key_t * keys, int sort);
+int syscrypt_read_keys(const char * key_file, int max_keys, syslog_crypto_key_t * keys, int sort)
+{
+	char key[100];
+	unsigned char raw_key[50];
+	char tmp[3];
+	FILE * f;
+	int loc_index;
+	int i;
+	int count = 0;
+	int rc = SYSCRYPT_OK;
+
+    f = fopen(key_file, "r");
+    if(f)
+    {
+        while(fgets(key, sizeof(key), f) && ((count < max_keys) || sort))
+        {
+			/* 6 digit for the index, 1 for the comma, 64 for the hex key */
+			if(strlen(key) != 72)
+			{
+				rc = SYSCRYPT_BAD_KEY_FILE;
+				break;
+			}
+			key[6] = 0;
+			loc_index = atoi(key);
+			tmp[2] = 0;
+			for(i = 0; i < 32; i++)
+			{
+				tmp[0] = key[(i * 2) + 7];
+				tmp[1] = key[(i * 2) + 8];
+				raw_key[i] = strtol(tmp, NULL, 16);
+			}
+			/* if we are to sort the key we put them in the array using the index in the key file
+			else we just add them to the array in the next available space */
+			if(sort && (loc_index < max_keys))
+			{
+				if(!AES_set_decrypt_key(raw_key, 256, &keys[loc_index].crypto_key))
+				{
+					keys[loc_index].index = loc_index;
+				}
+				else
+				{
+					rc = SYSCRYPT_BAD_KEY_FILE;
+					break;
+				}
+			}
+			else if(!sort)
+			{
+				if(!AES_set_encrypt_key(raw_key, 256, &keys[count].crypto_key))
+				{
+					keys[count].index = loc_index;
+				}
+				else
+				{
+					rc = SYSCRYPT_BAD_KEY_FILE;
+					break;
+				}
+			}
+			count++;
+		}
+		fclose(f);
+	}
+	if(!rc)
+	{
+		rc = count;
+	}
+	
+	return rc;
+}
+
+int syscrypt_init_encrypt_keys(const char * key_file)
+{
+	int rc;
+	
+	g_encrypt_keys = (syslog_crypto_key_t *) malloc(sizeof(syslog_crypto_key_t) * MAX_ENCRYPT_KEYS);
+	memset(g_encrypt_keys, 0, sizeof(syslog_crypto_key_t) * MAX_ENCRYPT_KEYS);
+	rc = syscrypt_read_keys(key_file, MAX_ENCRYPT_KEYS, g_encrypt_keys, 0);
+	if(rc <= 0)
+	{
+		free(g_encrypt_keys);
+		g_encrypt_keys = 0;
+		rc = SYSCRYPT_BAD_KEY_FILE;
+	}
+	else
+	{
+		g_num_encrypt_keys = rc;
+	}
+	return rc;
+}
+
+int syscrypt_init_decrypt_keys(const char * key_file)
+{
+	int rc; 
+	
+	g_decrypt_keys = (syslog_crypto_key_t *) malloc(sizeof(syslog_crypto_key_t) * MAX_DECRYPT_KEYS);
+	memset(g_decrypt_keys, 0, sizeof(syslog_crypto_key_t) * MAX_DECRYPT_KEYS);
+	rc = syscrypt_read_keys(key_file, MAX_DECRYPT_KEYS, g_decrypt_keys, 1);
+	if(rc <= 0)
+	{
+		free(g_decrypt_keys);
+		g_decrypt_keys = 0;
+		rc = SYSCRYPT_BAD_KEY_FILE;
+	}
+	else
+	{
+		g_num_decrypt_keys = rc;
+	}
+	return rc;
+}
+
+int syscrypt_encrypt(char * in, int len, unsigned char * out)
+{
+	char in_buf[AES_BLOCK_SIZE + 1];
+	int offset;
+	int rand_key;
+	unsigned char * orig_out = out;
+	
+	if(!g_encrypt_keys)
+		return SYSCRYPT_NOT_INITIALIZED;
+
+	rand_key = random() % g_num_encrypt_keys;
+	
+	memset(in_buf, 0, sizeof(in_buf));
+
+	/* encrypt the header (the key we are using and the 1st 10 bytes), always use key 0 for this */
+	sprintf(in_buf, "%06d", g_encrypt_keys[rand_key].index);
+	memcpy(&in_buf[6], in, (len < 10) ? len : 10);
+	AES_encrypt(in_buf, out, &g_encrypt_keys[0].crypto_key);
+
+	offset = 10;
+	out += AES_BLOCK_SIZE;
+	
+	while((offset + AES_BLOCK_SIZE) < len)
+	{
+		AES_encrypt(&in[offset], out, &g_encrypt_keys[rand_key].crypto_key);
+		out += AES_BLOCK_SIZE;
+		offset += AES_BLOCK_SIZE;
+	}
+	if(offset < len)
+	{
+		memset(in_buf, 0, sizeof(in_buf));
+		memcpy(in_buf, &in[offset], len - offset);
+		AES_encrypt(in_buf, out, &g_encrypt_keys[rand_key].crypto_key);
+	}
+	
+	out = orig_out;
+	return offset + AES_BLOCK_SIZE + 6;
+}
+
+int syscrypt_decrypt(unsigned char * in, char * out)
+{
+	int num_blocks;
+	int i;
+	char out_buf[AES_BLOCK_SIZE + 1];
+	int rand_key;
+		
+	if(!g_decrypt_keys)
+		return SYSCRYPT_NOT_INITIALIZED;
+	
+	num_blocks = strlen(in) / AES_BLOCK_SIZE;
+	if(!num_blocks)
+		return SYSCRYPT_BAD_INPUT;
+	
+	/* decode header */
+	AES_decrypt(in, out_buf, &g_decrypt_keys[0].crypto_key);
+	memcpy(out, &out_buf[6], 10);
+	out_buf[6] = 0;
+	rand_key = atoi(out_buf);
+	if(rand_key > MAX_DECRYPT_KEYS)
+	{
+		return SYSCRYPT_BAD_INPUT;
+	}
+
+	out += 10;
+	in += AES_BLOCK_SIZE;
+	for(i = 1; i < num_blocks; i++)
+	{
+		AES_decrypt(in, out, &g_decrypt_keys[rand_key].crypto_key);
+		out += AES_BLOCK_SIZE;
+		in += AES_BLOCK_SIZE;
+	}
+	*out = 0;
+
+	return SYSCRYPT_OK;
+}
diff -Naur busybox-1.7.2/libbb/syscrypt_api.h busybox-1.7.2_new/libbb/syscrypt_api.h
--- busybox-1.7.2/libbb/syscrypt_api.h	1969-12-31 16:00:00.000000000 -0800
+++ busybox-1.7.2_new/libbb/syscrypt_api.h	2007-11-11 05:09:31.000000000 -0800
@@ -0,0 +1,17 @@
+/*
+ *  syscrypt_init.h
+ *  syscrypt
+ *
+ *  Copyright 2007 Ooma Inc. All rights reserved.
+ *
+ */
+
+#define SYSCRYPT_OK					0
+#define SYSCRYPT_NOT_INITIALIZED	-1
+#define SYSCRYPT_BAD_KEY_FILE		-2
+#define SYSCRYPT_BAD_INPUT			-3
+
+int syscrypt_init_encrypt_keys(const char * key_file);
+int syscrypt_init_decrypt_keys(const char * key_file);
+int syscrypt_encrypt(char * in, int len, unsigned char * out);
+int syscrypt_decrypt(unsigned char * in, char * out);
diff -Naur busybox-1.7.2/Makefile.flags busybox-1.7.2_new/Makefile.flags
--- busybox-1.7.2/Makefile.flags	2007-09-03 04:48:58.000000000 -0700
+++ busybox-1.7.2_new/Makefile.flags	2007-11-11 05:09:31.000000000 -0800
@@ -9,7 +9,7 @@
 CPPFLAGS += $(call cc-option,-std=gnu99,)
 
 CPPFLAGS += \
-	-Iinclude -Ilibbb \
+	-Iinclude -Ilibbb -I../../../fusiv_src/user/openvpn \
 	$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) -I$(srctree)/libbb \
 	-include include/autoconf.h \
 	-D_GNU_SOURCE -DNDEBUG \
@@ -59,7 +59,7 @@
 LDFLAGS += -static
 endif
 
-BBOX_LIB_LIST = m crypt
+BBOX_LIB_LIST = m crypto crypt dl
 
 ifeq ($(CONFIG_PAM),y)
 BBOX_LIB_LIST += pam pam_misc
@@ -82,6 +82,8 @@
 
 #LDFLAGS += -nostdlib
 
+LDFLAGS += -L../../../oomaroot/lib
+
 LDFLAGS_ELF2FLT = -Wl,-elf2flt
 ifneq (,$(findstring $(LDFLAGS_ELF2FLT),$(LDFLAGS)))
 SKIP_STRIP = y
diff -Naur busybox-1.7.2/sysklogd/syslogd.c busybox-1.7.2_new/sysklogd/syslogd.c
--- busybox-1.7.2/sysklogd/syslogd.c	2007-09-03 04:48:35.000000000 -0700
+++ busybox-1.7.2_new/sysklogd/syslogd.c	2007-11-14 09:18:51.000000000 -0800
@@ -26,6 +26,7 @@
 
 #if ENABLE_FEATURE_REMOTE_LOG
 #include <netinet/in.h>
+#include "syscrypt_api.h"
 #endif
 
 #if ENABLE_FEATURE_IPC_SYSLOG
@@ -42,7 +43,7 @@
  * (semaphores are down but do_mark routine tries to down them again) */
 #undef SYSLOGD_MARK
 
-enum { MAX_READ = 256 };
+enum { MAX_READ = 1024 };
 
 /* Semaphore operation structures */
 struct shbuf_ds {
@@ -71,6 +72,7 @@
 	/* udp socket for remote logging */     \
 	int remoteFD;                           \
 	len_and_sockaddr* remoteAddr;           \
+	const char *remoteLogServer;            \
 ) \
 USE_FEATURE_IPC_SYSLOG( \
 	int shmid; /* ipc shared memory id */   \
@@ -142,6 +144,7 @@
 	USE_FEATURE_REMOTE_LOG(    OPTBIT_remote     ,)	// -R
 	USE_FEATURE_REMOTE_LOG(    OPTBIT_localtoo   ,)	// -L
 	USE_FEATURE_IPC_SYSLOG(    OPTBIT_circularlog,)	// -C
+	USE_FEATURE_REMOTE_LOG(    OPTBIT_syscrypt   ,)	// -e
 
 	OPT_mark        = 1 << OPTBIT_mark    ,
 	OPT_nofork      = 1 << OPTBIT_nofork  ,
@@ -153,23 +156,26 @@
 	OPT_remotelog   = USE_FEATURE_REMOTE_LOG(    (1 << OPTBIT_remote     )) + 0,
 	OPT_locallog    = USE_FEATURE_REMOTE_LOG(    (1 << OPTBIT_localtoo   )) + 0,
 	OPT_circularlog = USE_FEATURE_IPC_SYSLOG(    (1 << OPTBIT_circularlog)) + 0,
+	OPT_syscrypt    = USE_FEATURE_REMOTE_LOG(    (1 << OPTBIT_syscrypt   )) + 0,
 };
 #define OPTION_STR "m:nO:l:S" \
 	USE_FEATURE_ROTATE_LOGFILE("s:" ) \
 	USE_FEATURE_ROTATE_LOGFILE("b:" ) \
 	USE_FEATURE_REMOTE_LOG(    "R:" ) \
 	USE_FEATURE_REMOTE_LOG(    "L"  ) \
-	USE_FEATURE_IPC_SYSLOG(    "C::")
+	USE_FEATURE_IPC_SYSLOG(    "C::") \
+	USE_FEATURE_REMOTE_LOG(    "e:"  ) 
 #define OPTION_DECL *opt_m, *opt_l \
 	USE_FEATURE_ROTATE_LOGFILE(,*opt_s) \
 	USE_FEATURE_ROTATE_LOGFILE(,*opt_b) \
-	USE_FEATURE_REMOTE_LOG(    ,*opt_R) \
-	USE_FEATURE_IPC_SYSLOG(    ,*opt_C = NULL)
+	USE_FEATURE_IPC_SYSLOG(    ,*opt_C = NULL) \
+	USE_FEATURE_REMOTE_LOG(    ,*opt_e)
 #define OPTION_PARAM &opt_m, &G.logFilePath, &opt_l \
 	USE_FEATURE_ROTATE_LOGFILE(,&opt_s) \
 	USE_FEATURE_ROTATE_LOGFILE(,&opt_b) \
-	USE_FEATURE_REMOTE_LOG(    ,&opt_R) \
-	USE_FEATURE_IPC_SYSLOG(    ,&opt_C)
+	USE_FEATURE_REMOTE_LOG(    ,&G.remoteLogServer) \
+	USE_FEATURE_IPC_SYSLOG(    ,&opt_C) \
+	USE_FEATURE_REMOTE_LOG(    ,&opt_e) 
 
 
 /* circular buffer variables/structures */
@@ -467,6 +473,22 @@
 }
 #endif
 
+#if ENABLE_FEATURE_REMOTE_LOG
+int ooma_is_time_set(void);
+int ooma_is_time_set(void)
+{
+    struct tm * tt;
+    time_t ttt;
+
+    ttt = time(NULL);
+    tt = localtime(&ttt);
+
+    /* if the time is not set the year will
+    be less than 2007 */
+    return (tt->tm_year >= 107);
+}
+#endif
+
 static void do_syslogd(void) ATTRIBUTE_NORETURN;
 static void do_syslogd(void)
 {
@@ -538,22 +560,43 @@
 		}
 
 		if (FD_ISSET(sock_fd, &fds)) {
-			int i;
+			int i, j;
 			i = recv(sock_fd, G.recvbuf, MAX_READ - 1, 0);
 			if (i <= 0)
 				bb_perror_msg_and_die("UNIX socket error");
+			/* remove line feeds they upset syslog-ng */
+			for(j = 0; j < i; j++)
+			{
+				if(G.recvbuf[j] == '\r' || G.recvbuf[j] == '\n')
+					G.recvbuf[j] = ' ';
+			}
 			/* TODO: maybe suppress duplicates? */
 #if ENABLE_FEATURE_REMOTE_LOG
 			/* We are not modifying log messages in any way before send */
 			/* Remote site cannot trust _us_ anyway and need to do validation again */
-			if (G.remoteAddr) {
+			if (option_mask32 & OPT_remotelog) {
 				if (-1 == G.remoteFD) {
-					G.remoteFD = socket(G.remoteAddr->sa.sa_family, SOCK_DGRAM, 0);
+					/* don't start logging remote until the time is set, this ensures that the 
+					dns server is up and running before we try to resolve the remote server's IP address */
+					if(!G.remoteAddr && ooma_is_time_set())
+						G.remoteAddr = host2sockaddr(G.remoteLogServer, 514);
+					if(G.remoteAddr)
+						G.remoteFD = socket(G.remoteAddr->sa.sa_family, SOCK_DGRAM, 0);
 				}
 				if (-1 != G.remoteFD) {
-					/* send message to remote logger, ignore possible error */
-					sendto(G.remoteFD, G.recvbuf, i, MSG_DONTWAIT,
-						&G.remoteAddr->sa, G.remoteAddr->len);
+    				if (option_mask32 & OPT_syscrypt) { // -e
+						char e_recvbuf[MAX_READ + 100];
+						int len = syscrypt_encrypt(G.recvbuf, i, e_recvbuf);
+                        /* send message to remote logger, ignore possible error */
+                        sendto(G.remoteFD, e_recvbuf, len, MSG_DONTWAIT,
+                            &G.remoteAddr->sa, G.remoteAddr->len);
+					}
+					else
+					{
+						/* send message to remote logger, ignore possible error */
+						sendto(G.remoteFD, G.recvbuf, i, MSG_DONTWAIT,
+							&G.remoteAddr->sa, G.remoteAddr->len);
+					}
 				}
 			}
 #endif
@@ -590,8 +633,9 @@
 		G.logFileRotate = xatou_range(opt_b, 0, 99);
 #endif
 #if ENABLE_FEATURE_REMOTE_LOG
-	if (option_mask32 & OPT_remotelog) { // -R
-		G.remoteAddr = xhost2sockaddr(opt_R, 514);
+	// if (option_mask32 & OPT_remotelog) // -R
+	if (option_mask32 & OPT_syscrypt) { // -e
+		syscrypt_init_encrypt_keys(opt_e);
 	}
 	//if (option_mask32 & OPT_locallog) // -L
 #endif
