Add log encryption function

Change-Id: I820a066fac8bcb4edce3957ac921822f5f39f944
diff --git a/mbtk/mbtk_logd/alog_read.c b/mbtk/mbtk_logd/alog_read.c
index 3f13ab6..b7303b7 100755
--- a/mbtk/mbtk_logd/alog_read.c
+++ b/mbtk/mbtk_logd/alog_read.c
@@ -195,7 +195,8 @@
     char timeBuf[32];
     char defaultBuffer[512];
     size_t totalLen;
-    
+    int index = 0;
+    int len = 0;
     struct stat s;
     char * ret = NULL;
     
@@ -232,7 +233,15 @@
 
     totalLen = snprintf(defaultBuffer, sizeof(defaultBuffer),
     "%s %c/%s (%d): %s\n", timeBuf, priChar, entry->tag, entry->pid, entry->message);
-
+    
+    len = strlen(defaultBuffer);
+    if(access("/etc/syslog_encrypt_flag", F_OK) == 0)
+    {
+        for(index = 0; index < len; index++)
+        {
+            defaultBuffer[index] ^= 1;
+        }
+    }
     ret = write(fd_radio, defaultBuffer, totalLen);
 
     return ret;