In this topic:

Install the Export Control

Use the Export Control

Encryption Key Types

Decrypt Internal Encryption

Decrypt 3DES Encryption

Export AVI with Encryption

Snapshot Export Control

Developer Tools  

A Snapshot "Export Control" makes it possible to access Screen Snapshots and Email Attachments without using the Dashboard interface. The Spector 360 installation includes a COM (Component Object Model) interface with an Export Control that allows you to decrypt the files or programmatically output selected Screen Snapshots in .AVI video format.  You need only the Export Control .dll, access to the File Storage Location, and a program set up as described below.

If you have upgraded your Spector 360 installation - It will be necessary install the NEW Export Control (ExportCtl2.dll) file. Because this is a new control with new arguments and methods, you will need to register the .dll before use. The new version of the control includes the ability to decrypt a file and enhances the “ExportAsAVI” function to export snapshots encrypted with 3DES.  

Install the Export Control

 To install the control:

  1. Locate the ExportCtrl2.dll file in your Spector 360 installation folder

  2. Copy it to the local system where you will run it, if necessary, or register it from its original location.

  3. Open the Windows Start menu and use the Run command to execute the following, where <LocalPath> is the folder where the .dll file resides:

    Regsvr32 /i <LocalPath>\ExportCtl2.dll
     

    For example:

    Regsvr32 /i C:\tools\ExportCtl2.dll

To uninstall the control:

Open the Windows Start menu and use the Run command and execute the following command:

Regsvr32 /u <LocalPath>\ExportCtl2.dll

Use the Export Control

Once the control is installed, you should be able to access the interface with any COM-enabled language, such as C++, C#, or Visual Basic.

To access and use the control:

First, create an object of type ExportCtl2Lib.SpecExport. Use this object to call methods from the Export Control in your program as follows. An example of a C# program is shown below the list of arguments.

  1. Files  – (array of strings) The array specifies  names of files to load. To obtain the filenames of screen snapshots, run the Simple Database API Stored Procedure with the Event Type ID of 3. The filename is returned in the 8th field of each retrieved record.

  2. EncryptKeyTypes – (array of integers) Specifies the encryption method for each file in the above array (they can be mixed). This array must be in alignment with the Files array. See Encryption Key Types below for valid values.

  3. EncryptPasswords – (array of strings) Supply the password for each element in the above Files array. The Files and Passwords arrays must be aligned, so that the first element in Passwords specifies the password for the first element in Files. Obtain the passwords from the same procedure used above; the password is returned in the final two encyrption key fields (type and GUID).

  4. SnapCounts  – (array of integers) Each integer specifies the snapshot count for each file. Obtain the count from the above procedure; the count (integer) is returned in the 9th field for each record.

  5. OutFile – (string) Specify the name of the output .AVI file.  The resulting video will be stored at the location and under the name you specify.

  6. BeginDate – (DateTime) Specify the beginning of the date and time range you wish to include in the export. Use the format: yyyy/mm/dd  hh:mm:ss

  7. EndDate  – (DateTime) Specify the ending of the date and time range to export. Only snapshots within the range will be included in the resulting .AVI. Use the format: yyyy/mm/dd  hh:mm:ss

  8. PadSeconds  – (BOOLEAN) Allows creation of an .AVI that plays close to real time. If TRUE, the export function will fill in any missing seconds (where there are no snapshots) by duplicating the previous frame. One pad frame is inserted for each second there is no new snapshot. If FALSE, no padding is supplied, and the frames are simply inserted directly from the available snapshots, one after another.

  9. PadThreshold – (integer) Only valid if PadSeconds is TRUE. Specifies the maximum number of frames to insert between time gaps. If the number of seconds (with no new snapshots) is greater than this value, the function will not insert ANY padding between those two frames. In the example below, the PadThreshold is set to 900. This means if a gap of 500 seconds occurs, 500 pad frames will be inserted. If a gap of 900 seconds occurs, no padding is used; the movie jumps directly to the next segment of user activity.

  10. Fps – (integer) Specifies the Frames Per Second value for the .AVI file; this is the speed at which snapshot frames are displayed in the movie.  

  11. PromptForCodec  – (BOOLEAN) If TRUE, then a UI will be displayed allowing the user to choose the Codec (see illustration above). This is the same UI that is displayed in a call to ChooseCodec(). If FALSE, then ChooseCodec() must have been called manually BEFORE the ExportAsAVI() command is first issued, otherwise this function will fail.

  12. ExportAsImages() – This function is not yet implemented.

  13. ExportFile() - Decrypts any attachment or snapshot file. Uses the following arguments:

  1. SourceFileName – (string) Specifies the full path to the encrypted source file.

  2. DestFileName – (string) Specifies the full path to the decrypted destination file. The argument must include path and filename information.

  3. EncryptKeyType – (integer) Specifies the encryption method used in the source file (SourceFileName). See “Encryption Key Types” below for valid values.

  4. EncryptPassword – (string) Specifies the password for SourceFileName.

Encryption Key Types

Value

Encryption

0

No encryption. If 0 is specified as the Encryption Key Type in ExportFile or ExportAsAVI, the file is simply copied.

1

Internal SpectorSoft encryption. Applies to Spector 360 Snapshot files.  If 1 is specified in ExportFile or ExportAsAVI, the file is decrypted for export.

2

3DES encryption. Applies to any file using 3DES encryption, either Attachments or Snapshots. If 2 is specified in ExportFile or ExportAsAVI, the file is decrypted for export.

Decrypt a Snapshot File (Internal Encyrption)

The following C# example decrypts a snapshot file using Internal encryption. The final line is the function call (specExport.ExportFile) and has no line breaks.

ExportCtl2Lib.SpecExport2 specExport = new ExportCtl2Lib.SpecExport2();

specExport.ExportFile("c:\\spectorsoft\\data\\snapshots\\B50A8499DF7D5EE1C2F741DA47DF60DC4BFB008E.yml", "C:\\spectorsoft\\decrypted\\Decrypted.sdf", 1, "testpass");

 

Decrypt an Attachment File (3DES)

The following C# example decrypts an email attachment file (.jpg) using 3DES encryption. The final line is the function call (specExport.ExportFile) and has no line breaks.

ExportCtl2Lib.SpecExport2 specExport = new ExportCtl2Lib.SpecExport2();

specExport.ExportFile("c:\\spectorsoft\\data\\attachments\\attach012949e.1", "C:\\spectorsoft\\decrypted\\attachment.jpg", 2, "{81EACCAC-A927-4f50-A8F3-6177DCB153C9}");

 

Export an AVI with Internal Encryption

The following C# example shows export of an AVI file using internal encryption. The final line is the function call (specExport.ExportAsAVI) and has no line breaks.

ExportCtl2Lib.SpecExport2 specExport = new ExportCtl2Lib.SpecExport2();

     DateTime dtStart;

     DateTime dtEnd;

 

     int[] counts = new int[1];

     string[] fileNames = new string[1];

     int[] encryptionTypes = new int[1];

     string[] passwords = new string[1];

 

     fileNames[0] = "c:\\spectorsoft\\data\\snapshots\\B50A8499DF7D5EE1C2F741DA47DF60DC4BFB008E.yml";

     encryptionTypes[0] = 1;

     passwords[0] = "testpass";

     counts[0] = 34;

 

     dtStart = DateTime.Parse("March 02, 2008 00:00:00");

     dtEnd = DateTime.Parse("March 03, 2008 00:00:00");

 

     object objFiles = fileNames;

     object objTypes = encryptionTypes;

     object objPass = passwords;

     object objCounts = counts;

 

     specExport.ExportAsAVI(ref objFiles, ref objTypes, ref objPass, ref objCounts, "c:\\spectorsoft\\exported\\testavi.avi", dtStart, dtEnd, true, 900, 1, false);

 

 

Related Topics