banr_bklrx.gificon_bw_about.gif (884 bytes)banr_homex_ico.gif (1035 bytes)banr_howbuyx_ico.gif (1114 bytes)banr_descfrx_ico.gif (1119 bytes)banr_hascfrx_ico.gif (1223 bytes)
crypt_tools4swdev.gif (2298 bytes)
Example Project: Create a Self-Decrypting Archive

This example VB project illustrates how to create a Self-Decrypting Archive in Visual Basic using the CipherLockSDA DLL.

Code:

Option Explicit
Private Sub Command1_Click()
  Dim Status As Long
  Dim myArch As Archive
  Set myArch = New Archive
  On Error GoTo MyErrHndlr
'
' Add one or more input files to the SDA
  myArch.AddInputFile (txtInFile1.Text)
  myArch.AddInputFile (txtInFile2.Text)
  myArch.AddInputFile (txtInFile3.Text)
'
' [Optional] Select a file to be executed when the SDA is decrypted.
' Note 1: only one file in an SDA can be 'ExecuteAfterDecrypt';
' if two or more are set, the last file named will be executed.
' Note 2: a file must be added before being named as 'ExecuteAfterDecrypt'
'
  myArch.ExecuteAfterDecrypt (txtInFile1.Text)
  myArch.ExecuteAfterDecrypt (txtInFile2.Text)
'
' Select the encryption algorithm to be used; triple_DES is default.
  myArch.Encryption = triple_DES
'
' Select data compression if desired; no compression is default.
  myArch.CompressData = True
'
' Select a password or passphrase (used to generate encryption key)
  myArch.Password = txtPasswd.Text
'
' Set the name for the SDA output file
  myArch.OutputFileName = txtOutFile.Text
'
' Make the SDA...
  myArch.CreateArchive
Exit Sub

MyErrHndlr:
MsgBox "Error #" & Err.Number & vbCrLf & Err.Description
End Sub

 

Notes:
1) This project DOES NOT contain a copy of the CipherLockSDA DLL. 
2) This project is not "production quality" code, but intended only to illustrate techniques that may be of use to VB developers using the CipherLockSDA/DLL in the MS VB development environment. You are free to use this sample project for any legal purpose provided you have a valid developer's license for CipherLockSDA. Bokler Software Corp. does not warrant, nor do we support this sample project.
3) See the Tech Support FAQ for more details and sample code.


Copyright ©, 1995-2000 Bokler Software Corp. All rights reserved. DEScipher, TDEScipher,  HASHcipher, CipherLock and CipherLockSDA are trademarks of Bokler Software Corp. The "animated_cipher.gif" is copyrighted by Bokler Software Corp. Microsoft, Windows, Visual Basic, Visual C++ and ActiveX are trademarks of Microsoft Corp.