Introduction
BigSpeed Secure Socket Library is an COM automation object that dramatically simplifies and accelerates the development of proprietary communication solutions
over the Internet. It implements a flexible message-oriented protocol on top of a single TCP connection. The transfered data are scrambled
using on-the-fly 128-bit AES encryption with random session keys, without need of SSL certificates.
The security is provided in two different modes: symmetric encryption with shared secret key
and asymmetric encryption with 1024-bit public/private keys. Transport level authentication is available with optional digital fingerprints or secret keys.
Building a virtual private application network is just a matter of setting the same crypto key on two or more sites.
The security model employs the two main cryptographic algorithms. The asymmetric encryption uses 1024-bit public/private keys,
which are fully maintained by the library, without need of SSL certificates.
Channel-level authentication is provided by optional digital fingerprints mechanism.
The symmetric encryption uses 128-bit AES algorithm with shared crypto keys.
Building a virtual private application network is just a matter of setting the same crypto key on two or more peers.
BigSpeed Secure Socket Library can be used both on peer and server side, with centralized management of all connections.
The library takes care of all low-level tasks: packetizing the information into named packets, compression, encryption, sending, receiving,
buffer congestion and flow control. It supports automatic DNS name resolution and SOCKS proxy servers.
BigSpeed Secure Socket Library utilizes an elegant event-driven paradigm for easy integration into Windows applications.
A special attention is paid to provide responsive user interface while maintaining maximum bandwidth efficiency.
Carefully designed set of properties, methods, and events offers great flexibility to develop innovative communication software.
Sample applications for chat, alert messaging, and file transfer are included in Visual Basic 6, Visual Basic .NET, and Delphi 7.
Installation
The BIGSPEED Secure Socket Library setup utility will copy all the necessary files into the installation
directory you selected and will register the COM object on your Windows system.
There are some additional steps you must take to complete the installation,
based on which development language you are using.
Installation instructions for Visual Basic 6.0
Start Visual Basic 6.0
Create a new project or open an existing one.
Select References from the Project menu.
An entry named "BIGSPEED Socket Library" should appear in the components list.
In the Components dialog, make sure the "BIGSPEED Socket Library" item is checked in the components list.
Click the OK button. This will make it available for use in your applications.
Installation instructions for Delphi 7
Start Delphi
Open an existing project or create a new project
From the Project menu, select the "Import Type Library" item
Select the "BIGSPEED Socket Library" item from the list of libraries
Check the "Generate Component Wrapper" checkbox
Enter the path for the new unit in the "Unit dir name" field.
Click on the "Create Unit" button that's on the Import Type Library dialog
Installation instructions for Visual Basic 2005
Start Visual Basic .NET
Create a new project or open an existing one.
From the Project menu, select the "Add Reference" item
In the "Add Reference" dialog, click the tab named "COM Components" .
An entry named "BIGSPEED Socket Library" should appear in the components list.
In the Components dialog, make sure the "BIGSPEED Socket Library" is checked in the components list.
Click the OK button. This will make it available for use in your applications.
LastError property
Data type
Integer (Read-only)
Default value
None
Description
LastError property returns the error code for the last method invocation. Zero indicates no error (success).
LocalIPList property
Data type
String (Read-only)
Default value
Empty
Description
LocalIPList property holds a comma-delimited list of available IP addresses of the local machine.
SecurityMode property
Data type
Integer
Default value
Zero
Description
SecurityMode property specifies what security mode to be used for the next connectuon sessions.
There are three possible values:
0 - Plain mode. No encryption is used.
1 - Symmetric encryption. The SecretKey property will be used by the component to
calculate a unique session key for each connection. The incomming connections will be limited only
to the peers which have assigned the same SecretKey.
2 - Asymmetric encryption. The PublicKey/PrivateKey properties will be used by the component to
calculate a unique session key for each connection. The incomming connections can be limited only
to a predefined list of peers by assigning the correct digital fingerprints to the property Fingerprints.
SecretKey property
Data type
String
Default value
Empty
Description
SecretKey property holds the cryptographic key used to calculate the session key when a symmetric encyption is used.
Only peers with the same secret key will be able to communicate to each other.
PublicKey property
Data type
String
Default value
Empty
Description
PublicKey property holds the public key used to calculate the session key in the asymmetric encryption mode.
It should be previously generated by the method GenerateKeypair.
PrivateKey property
Data type
String
Default value
Empty
Description
PrivateKey property holds the private key used to calculate the session key in the asymmetric encryption mode. It should be previously generated
by the method GenerateKeypair.
Fingerprints property
Data type
String
Default value
Empty
Description
Fingerprints property optionally can be used to restrict the incomming connection only to certain peers.
The expected format is a comma-delimited list of digital fingerprints, as calculated by the method TakeFingerprint.
ClientAddress property
Data type
String
Default value
Empty
Description
If the local machine has multiple network interfaces, this property can specify which one to be used for outgoing connections.
If the value is empty, the default IP address will be used.
ServerAddress property
Data type
String
Default value
Empty
Description
ServerAddress property allows you to choose the bind address for the server side, if the local machine has more than one IP address.
If it's not specified, the default address will be used.
ServerPort property
Data type
Integer
Default value
0
Description
This property holds the port of the Server, when the session is open.
SocksVersion property
Data type
Integer
Default value
4
Description
This property specifies the version of the SOCKS protocol to be used. Valid values are "4" and "5".
SocksServer property
Data type
String
Default value
Empty
Description
SocksServer property sets the address of the proxy server. It accepts dotted decimal format or domain name.
SocksPort property
Data type
Integer
Default value
0
Description
SocksPort property indicates the port of the proxy server.
SocksUsername property
Data type
String
Default value
Empty
Description
SocksUsername property specifies the user name to be used for proxy server authentication.
SocksPassword property
Data type
String
Default value
Empty
Description
SocksPassword property specifies the password to be used for proxy server authentication.
GenerateKeypair method
Declaration
GenerateKeypair(
ByRef aPublicKey As String,
ByRef aPrivateKey As String
) As Boolean
Description
This method generates a new random key pair of public and private keys.
They can be used for the properties PublicKey and PrivateKey.
Parameters
aPublicKey
The Base64 encoded value of the generated public key is returned here
aPublicKey
The Base64 encoded value of the generated private key is returned here
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError
can be used to retrieve the error code.
Example
Ok = GenerateKeypair( PubKey, PvtKey )
TakeFingerprint method
Declaration
TakeFingerprint(
aPublicKey As String
) As String
Description
This method calculates a digital fingerprint (MD5 checksum) of a public key.
Parameters
aPublicKey
Base64 encode value of the public key.
Return
The return value is the Base64 encoded MD5 checksum. It can be used in the property Fingerprints on the remote peers.
Example
FP = TakeFingerprint( PubKey )
StartListening method
Declaration
StartListening(
) As Boolean
Description
StartListening method instructs the library to start listening for new incoming connections.
Parameters
None
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
StopListening method
Declaration
StopListening(
) As Boolean
Description
StopListening method instructs the library to stop listening for new incoming connections.
All currently connected peers will continue to stay connected.
Parameters
None
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError
can be used to retrieve the error code.
IsListening method
Declaration
IsListening(
) As Boolean
Description
IsListening indicates if local server is currently running
Parameters
None
Return
If the return value is TRUE the local server has been started with StartListening method
GetMoniker method
Declaration
GetMoniker(
ByVal aHandle As Integer
) As Integer
Description
GetMoniker method provides the moniker ID associated with the peer object.
It should be previously set with SetMoniker method.
Parameters
aHandle
Handle of the desired peer object.
Return
Integer value representing the moniker ID.
SetMoniker method
Declaration
SetMoniker(
ByVal aHandle As Integer
,ByVal aMoniker As Integer
)
Description
SetMoniker method assigns a moniker ID (4 byte integer) to a peer object.
This could be helpful for easy reference to some application data associated with the peer.
Parameters
aHandle
Handle of the desired peer object.
aMoniker
The moniker ID value
Return
None.
OpenSession method
Declaration
OpenSession(
ByVal aHost As String
, ByVal aPort As Integer
, ByVal aProtocol As String
, ByVal aUsername As String
, ByVal aPassword As String
) As Integer
Description
OpenSession method issues a request to establish a connection to a remote peer.
It creates a new peer object and returns its handle.
The application will be notified later on for the result of the operation.
If the peer is connected successfully the event OnSessionOpen will be fired,
otherwise the event OnSessionRejected will be fired.
Parameters
aHost
The address of the repote peer. It can be in dotted decimal format or domain name.
aPort
The listening port number of the remote peer.
aProtocol
This an optional string representing the protocol name in use. It should be checked on the remote side for matching
aUsername
The username for logging in to the remote peer. If it's empty, the default (Guest) account will be used
aPassword
The password needed for the login operation. Should be empty for Guest login.
Return
If the return value is zero the method invocation is not successful and the property LastError
can be used to retrieve the error code.
If the return value is not zero, it is the handle of the newly created peer object.
CloseSession(
ByVal aHandle As Integer
) As Boolean
Description
CloseSession method disconnects and destroys a peer object.
The event OnSessionClosed will be fired as a result of the request.
Parameters
aHandle
Handle of the desired peer object.
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code.
GetPeerState method
Declaration
GetPeerState(
ByVal aHandle As Integer
) As Integer
Description
GetPeerState method provides information about the current state of a connection.
Parameters
aHandle
Handle of the desired peer object.
Return
An integer code with the following meaning:
0
Disconnected
1
Connecting
2
Connected
ServerConnection method
Declaration
ServerConnection(
ByVal aHandle As Integer
) As Boolean
Description
This method whether tne connection is incoming or outgoing
Parameters
aHandle
Handle of the desired peer object.
Return
If returned value is TRUE, the connection is incoming, otherwise it's outgoing
GetUsername method
Declaration
GetUsername(
ByVal aHandle As Integer
) As String
Description
GetUsername method provides the username associated with a peer object.
Parameters
aHandle
Handle of the desired peer object.
Return
Name of the logged in user.
GetPeerAddress method
Declaration
GetPeerAddress(
ByVal aHandle As Integer
) As String
Description
GetPeerAddress gives the peer IP address.
Parameters
aHandle
Handle of the desired peer object.
Return
Peer address in IP dotted format.
GetPeerPort method
Declaration
GetPeerPort(
ByVal aHandle As Integer
) As Integer
Description
GetPeerPort method gives the peer port number.
Parameters
aHandle
Handle of the desired peer object.
Return
Peer port number.
GetOkayCount method
Declaration
GetOkayCount(
ByVal aHandle As Integer
, ByVal aCode As Integer
) As Integer
Description
GetOkayCount method tells how many packets have been sent but are still not confirmed from the remote side
Parameters
aHandle
Handle of the desired peer object.
aCode
Packets with this command code will be counted only.
Return
Number of packects awaiting for acknowledgment.
c_GetOkaySize method
Declaration
c_GetOkaySize(
ByVal aHandle As Integer
, ByVal aCode As Integer
) As Integer
Description
GetOkayCount method tells what is the total data size of packets have been sent but are still not confirmed from the remote side
Parameters
aHandle
Handle of the desired peer object.
aCode
Packets with this command code will be counted only.
Return
Total data size of packects awaiting for acknowledgment.
GetFreeRoom method
Declaration
GetFreeRoom(
ByVal aHandle As Integer
) As Integer
Description
GetFreeRoom method gives the maximum amount of bytes that could be placed in the buffer with xxxToBuffer methods
for the next packet to be sent. This is just a recommendation to keep the socket more responsive to
the queries from the application. The free room depends on the connection speed and data load.
Parameters
aHandle
Handle of the desired peer object.
Return
Available room in bytes
TextToBuffer method
Declaration
TextToBuffer(
ByVal aHandle As Integer
, ByVal aValue As String
) As Boolean
Description
This method places a text string into the outgoing buffer for later sending
Parameters
aHandle
Handle of the desired peer object
aValue
Value to be placed in the buffer
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
TextFromBuffer method
Declaration
TextFromBuffer(
ByVal aHandle As String
) As String
Description
This method retrieves a text string from the incoming buffer
Parameters
aHandle
Handle of the desired peer object.
Return
The return value is extracted from the data in the buffer received with the last packet
IntegerToBuffer method
Declaration
IntegerToBuffer(
ByVal aHandle As Integer
, ByVal aValue As Integer
) As Boolean
Description
This method places an integer value (4 byte) into the outgoing buffer for later sending
Parameters
aHandle
Handle of the desired peer object
aValue
Value to be placed in the buffer
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
IntegerFromBuffer method
Declaration
IntegerFromBuffer(
ByVal aHandle As Integer
) As String
Description
This method retrieves an integer value from the incoming buffer
Parameters
aHandle
Handle of the desired peer object.
Return
The return value is extracted from the data in the buffer received with the last packet
BooleanToBuffer method
Declaration
BooleanToBuffer(
ByVal aHandle As Integer
, ByVal aValue As Boolean
) As Boolean
Description
This method places a boolean value into the outgoing buffer for later sending
Parameters
aHandle
Handle of the desired peer object
aValue
Value to be placed in the buffer
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
BooleanFromBuffer method
Declaration
BooleanFromBuffer(
ByVal aHandle As Boolean
) As String
Description
This method retrieves a boolean value from the incoming buffer
Parameters
aHandle
Handle of the desired peer object.
Return
The return value is extracted from the data in the buffer received with the last packet
BytesToBuffer method
Declaration
BytesToBuffer(
ByVal aHandle As Integer
, ByVal aValue As Object
) As Boolean
Description
This method places byte data into the outgoing buffer for later sending
Parameters
aHandle
Handle of the desired peer object
aValue
Byte data to be placed in the buffer. They need to be formated as variant array of bytes
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
BytesFromBuffer method
Declaration
BytesFromBuffer(
ByVal aHandle As Integer
) As Object
Description
This method retrieves byte data from the incoming buffer
Parameters
aHandle
Handle of the desired peer object.
Return
The return value is extracted from the data in the buffer received with the last packet. They are formatted as variant array of byte
CompressData method
Declaration
CompressData(
ByRef aData As Object
) As Boolean
Description
This method compreseses in-memory data buffer
Parameters
aData
Byte data to be compressed. They need to be formated as variant array of bytes
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
DecompressData method
Declaration
DecompressData(
ByRef aData As Object
) As Boolean
Description
This method decompreseses in-memory data buffer
Parameters
aData
Byte data to be decompressed. They need to be formated as variant array of bytes
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
SendPacket method
Declaration
SendPacket(
ByVal aHandle As Integer
, ByVal aCode As Integer
, ByVal aNeedOkay As Boolean
) As Boolean
Description
This method builds a packet from the data in the outgoing buffer and places it into the sending queue.
The buffer is emptied immediately. The event OnPacketSent will be fired when an acknowledgment is received from the remote side
Parameters
aHandle
Handle of the desired peer object
aCommand
Command code associated with this packet
aNeedOkay
if set to TRUE, a confirmation will be received from remote side
Return
If the return value is TRUE the method invocation is successful. Otherwise the property LastError can be used to retrieve the error code
OnSessionRequest event
Declaration
OnSessionRequest(
ByVal aHandle As Integer
, ByVal aProtocol As String
, ByVal aUsername As String
, ByRef aPassword As String
, ByRef aAccept As Boolean
)
Description
This event notifies about a request for a new incoming connection.
The application should check the user profile and return the value of the password.
Parameters
aHandle
Handle of the peer object.
aProtocol
This is the value of Protocol parameter in OpenSession call on the remoreside. The application should check if it can be supported before accepting the connection.
aUsername
Name of the desired user. If it's empty, user is considered to be the anonymous/guest user (the user with no name)
aPassword
This is an out parameter. If the username is found in user profile,
the application must pass here the password value set for the asked username previously by the administrator.
aAccept
If the aplication wants to establish the connection, this value must be set to True
OnSessionInvoked event
Declaration
OnSessionInvoked(
ByVal aHandle As Integer
)
Description
This event is generated when an incoming connection has just been established successfully.
It means the password provided in OnSessionRequest event was correct and the peer object is ready for use.
Parameters
aHandle
Handle of the peer object.
OnInvocationRejected event
Declaration
OnSessionClosed(
ByVal aHandle As Integer
, ByVal aCode As Integer
)
Description
This event is generated when an incoming connection has just been refused.
It means the password provided in OnSessionRequest event was not correct.
After this event the peer object gets destroyed and its handle becomes invalid.
Parameters
aHandle
Handle of the peer object.
aCode
Error code
OnSessionOpen event
Declaration
OnSessionOpen(
ByVal aHandle As Integer
)
Description
OnSessionOpen event is generated when a new peer has just been connected after a call to "OpenSession".
The peer object switches from connecting to connected state.
Parameters
aHandle
Handle of the peer object.
OnSessionRejected event
Declaration
OnSessionClosed(
ByVal aHandle As Integer
, ByVal aCode As Integer
)
Description
This event is generated when an outgoing connection has just been refused.
After this event the peer object gets destroyed and its handle becomes invalid.
Parameters
aHandle
Handle of the peer object.
aCode
Error code
OnSessionClosed event
Declaration
OnSessionClosed(
ByVal aHandle As Integer
, ByVal aCode As Integer
)
Description
This event is generated when a connection has just been broken.
After this event the peer object gets destroyed and its handle becomes invalid.
Parameters
aHandle
Handle of the peer object.
aCode
Error code
OnPacketReceived event
Declaration
OnPacketReceived(
ByVal aHandle As Integer
, ByVal aCode As Integer
)
Description
This event is generated when a new packet has been just received.
All received data should be retrieved immediately with the methods xxxFromBuffer.
Parameters
aHandle
Handle of the peer object.
aCode
The command code used in SendPacket call on the remote side
OnPacketSent event
Declaration
OnPacketSent(
ByVal aHandle As Integer
, ByVal aCode As Integer
)
Description
This event is generated when an acknowledgement is received for a packet from the remote side.
The packet must be sent with a parameter NeedOkay set to TRUE in the SendPacket call.
Parameters
aHandle
Handle of the peer object
aCode
The command code used in SendPacket call
Error codes
0
No error
1
User action
2
Unknown error
3
Invalid handle
4
Invalid data
5
There is no assigned event handler
6
Illegal operation
7
Event handler error
8
Bad encryption key
10
Connection is refused
11
Connection timeout
12
Broken connection
13
Not connected
14
Too many connections
20
Cannot start server
21
Cannot connect to SOCKS server
22
Wrong username or password
23
Access is denied
24
peer is not signed-in
30
Operation is already running
31
Operation is not running
100
Cannot create folder
101
Cannot delete folder
102
Cannot delete file
103
Cannot rename folder
104
Cannot rename file
105
Cannot open file
106
Cannot create file
107
Cannot read from file
108
Cannot write to file
109
Cannot rename temporary file
110
Non-supported format
111
Error searching file
112
Wrong checksum
Description
If the error code is negative, the cause is on the remote side.
License Agreement
License for using BIGSPEED Secure Socket Library (hereinafter referred to as this Software) from BIGSPEED Computing Inc.
By using the information contained in this document you agree to be and are hereby bound
by the terms of this License Agreement. If you do not agree to the terms of this Agreement,
do not use the information contained in this document.
Licensing
BIGSPEED Computing grants Licensee the non-exclusive license to use this Software on a single computer at any
given time for the sole purpose of developing any number of end user applications, providing that each
application adheres to the following conditions:
(a) The application may not compete with this Software.
(b) The application may not expose the functionality of this Software through a programmable interface.
It is forbidden to use the library for the production of developer tools, components or libraries.
There are two licensing options available depending on your needs.
If you have not paid for this Software, you are hereby granted a Freeware License
to use the Free Edition as described below.
If you have paid the appropriate fee for this Software, you are hereby granted
a Registered license to use the Base/Plus Editions as described below.
Freeware License
You may use the Free Edition of BIGSPEED Secure Socket Library for the purpose of developing
end user applications, providing that each application shall only be used for purposes that
neither directly nor indirectly have any commercial implications. You may redistribute
the binary code of the Free Edition with your completed application. The application
MUST acknowledge this Software in a reasonable place (Help file, About box etc).
If this Software is to be used in a commercial product, or incorporated into anything that is to be
sold to a third party, then a Registered License must be purchased from BIGSPEED Computing.
The Free Edition distribution package may be freely distributed, provided it is not modified in any way.
No person or company may charge a fee for the distribution of BIGSPEED Secure Socket Library
without written permission from the copyright holder.
Registered License
You may use the Base/Plus Editions of BIGSPEED Secure Socket Library for the purpose of developing
end user commercial applications. A Registered License is issued to a specific company or organization,
and entitles that organization to incorporate the binary code of this Software into commercial
applications under the Licensee's brand name. There is no restriction on the number of products,
or product types, incorporating the library binary code.
If Licensee has purchased a "multi-developer" license, this Software may be used on more than one computer
at Licensee's premises by the number of software developers associated with the multi-developer license.
Limited warranty
BIGSPEED Computing Inc. cannot be held responsible under any circumstances for damages
of any character (including, but not limited to, direct or indirect damages
resulting from the loss of
business profits, business interruption, loss of business information, or
other pecuniary loss) arising out of the use or inability to use this product.
This software is provided under license on an "AS IS" basis, without warranty
of any kind, expressed or implied, including without limitation, implied warranties
of merchantability and fitness for a particular purpose. BIGSPEED Computing Inc. or any
third party involved in the creation, production, or delivery of the program,
cannot be held responsible under any circumstances, for any direct or indirect
damage, including loss of profits, interruption of business activities, or
other, faced by the user of this program, even in the case that BIGSPEED Computing Inc.
has been advised of such damages.
The user assumes responsibility for the result or performance of the program.
BIGSPEED Computing Inc. may, at any time, revoke this license by notifying the user of
the software. The user may cancel his license to use the product by destroying
or erasing all copies of the software.
Export restrictions
You acknowledge that this Software licensed hereunder is subject to the Wassenaar Arrangement regulations, and any amendments thereof.
You confirm that with respect to this Software, you will not export or re-export it, directly or indirectly, to any countries that are subject to Wassenaar Arrangement export restrictions.
You further acknowledge that this software may include technical data subject to export and re-export restrictions imposed by Wassenaar Arrangement.
Property
BIGSPEED Secure Socket Library, including its code, documentation, appearance, structure, and
organization is an exclusive product of BIGSPEED Computing Inc., who retains the property
rights to the software, its copies, modifications, or merged parts.
System requirements
System requirements
Windows 9x, Me, NT4 or Windows 2000, XP or higher version
Pentium Processor recommended
16 MB RAM; 32 MB RAM under NT4 or Windows 2000 platforms, 128 MB for XP
Any programming language supporting ActiveX controls
(c) BIGSPEED Computing Inc. 1998-. Mastering algorithms.