EasyByte Software

Welcome to EasyByte Software

Home Buy Online Products Downloads Support
ASP and dotNET
Further Information



CreateArchive Method

Cryptocx v7 User Guide


CreateArchive Method

This is the method that you use to create a Self Decrypting Archive (SDA). An SDA is an executable file that when run prompts for a password, if the password entered is correct then the archive will decrypt the files stored within it. It is perfect for sending off to people that may not have any encryption software on their PC.


Ultra Customisable

The Cryptocx SDA functionality is extremely customisable, the SDA that is created by Cryptocx can have your own Icon and Background image along with control over the positioning of the controls on the SDA. You can also specify what will happen once an SDA has been decrypted on another computer, for example to execute a file or open windows explorer for the user.


SDA Contents

The SDA can consist of any number of directories or individual files. Cryptocx will automatically recurse any directories specified and will include all files and subdirectories within those specified directories.

The encryption algorithm used is the 256 Bit AES encryption algorithm at all stages during the creation of the archive. 

Creation of the archive is an automatic two stage process, the first stage is for the compression of all files, in memory, then the compressed files are encrypted using AES before being packed into the Archive.

The SDA has all the required decryption and decompression functionality inserted into it.



Create a Self Decrypting Archive (SDA)


x = object.CreateArchive

The syntax of the CreateArchive method has these parts:

Part Description
object A Cryptocx v7 control.
x A string that becomes either "TRUE" or "Error: xxx" where xxx is the error message.

Remarks You can run the resultant SDA from a command line, just providing the password as a command line option to it. If the password is wrong it will do a silent exit if it is correct it will automatically decrypt in the directory it is residing in.

You must separate multiple files and directories you wish to have in the SDA by the separator *

The ArchiveCaption property must be set. This is the caption that will appear in the SDA when run. In this picture the SDA has a caption of 'My Archive'


The properties you can set when creating an SDA are:

Optional - ArchiveBackground 
Required - ArchiveCaption 
Optional - ArchiveControlPosition 
Optional - ArchiveExecuteFile 
Optional - ArchiveIcon 
Optional - ArchiveOpenExplorer
Required - SourceFile
Required - DestinationFile
Required - Password



Example Sample Visual Basic Code to create an SDA

Where Cryptocx is an instance of a Cryptocx Control.

Where lstSDA is a listbox that will contain all of the files and or directories to include in the SDA.



'' Build up the list of Files/Dir to have in the Archive
'' They are separated by *
'' * was chosen as the separator as you are not able to have file
'' names or directory names with * in

Dim names As String
Dim i As Integer

names = ""

'' There are no files or directories specified to add to an archive

If lstSDA.ListCount < 1 Then
 MsgBox "You must sepcify at least one file to add to an archive"
 GoTo eds
End If

For i = 0 To lstSDA.ListCount - 1
 names = Trim(lstSDA.List(i)) + "*" + names
Next i

'' Remove the last *

names = Mid(names, 1, Len(names) - 1)

'' Now create the SDA

Dim Cryptocx As New EasyByte_Software.Cryptocxv7

Cryptocx.LicenseKey = "DEMO"

'' Most of these properties are optional, you can just specify an empty string for them

Cryptocx.SourceFile = names
Cryptocx.ArchiveBackground = "c:\boats.bmp"
Cryptocx.ArchiveIcon = "c:\myicon.ico"
Cryptocx.ArchiveCaption = "My Archive"
Cryptocx.Password = "mypassword"
Cryptocx.ArchiveControlPosition = "bottom"
Cryptocx.ArchiveOpenExplorer = "no"
Cryptocx.ArchiveExecuteFile = ""
Cryptocx.DestinationFile = "C:\myarchive.exe"

x = Cryptocx.CreateArchive

'' See if the archive was created ok

If x = "TRUE" Then
 MsgBox x
End If






Back to Contents Page


Click here to set this great site as your home page

Or click here to add it to your Favorites.


Copyright (c) EasyByte Software 1998-2008, info@easybyte.com