Example using SSLab

How to use SSLaB APIs in your software program

The SSLaB Logger API functions included in the libLogger.a library are:

  • The LoggerStartUp() initializes the logger internal storage area structure and starts the logger.
  • The LoggerLogMsg() stores a software program log message to the logger internal encoded storage area structure.
  • The LoggerSaveStorageAreaToFile() saves the current internal storage area structure to an encrypted disk file.
  • The LoggerShutDown() stops the logger and save any log messages in the internal storage area structure to an encrypted disk file.

The following sample C program my_sample.c shows how to use the above SSLaB Logger APIs. Note that the third argument to LoggerLogMsg() on line 10 is an integer value of “2”. This integer value is a replacement for the actual message text string. With this approach the string text in not included in the executable, and therefore cannot be reverse engineered and extracted from the application executable file. Note: There are no header files needed. Just compile the my_sample.c with the library.

1. #include <stdio.h>
2. enum components { UI=1, LG=2, DB=3 };
3. enum severity { FATAL=1, INFO=2 };
4. main()
5. {
6.    LoggerStartUp(1);
7.       …other application code…
8.    LoggerLogMsg(DB,FATAL,1, 102, 103, 104, 105, 106);
9.       …other application code…
10.    LoggerLogMsg(LG,INFO,2, “Four”);
11.       …other application code…
12.    LoggerShutDown();
13. }

The following commands show how to execute the my_sample compiled program to produce an encoded/encrypted audit/log file 03032020_16:55:49_001.efl:

$ my_sample
$ ls

Using the SSLaB Browser to view audit/log messages

To view the encoded/encrypted audit/log message, use the Secure Software Browser (i.e., browser) to decode/unencrypt the 03032020_16:55:49_001.efl file to produce an unencoded/decrypted plain text file 03032020_16:55:49_001.log.

$ browse -i 03032020_16:55:49_001.efl
$ ls
$ cat 03032020_16:55:49_001.log
02/21/2020 11:09:16 [22237] [DB] [INFO] This message contains five integers=[102, 103, 104, 105, 106]
02/21/2020 11:09:16 [22237] [LG] [INFO] This message contains one string=[Four]

Copyright 2013-2021 ISTECH.COM. All rights reserved. Patent Pending.