Cast 128 ActiveX component

Coded by Midori ( ), original cast 128 implementation by Steve Reid <sreid@sea-to-sky.net>
http://www.paipai.net

NEW release of THIS component available: please visit http://www.paipai.net/texts/components.htm
Versione in italiano:
http://www.paipai.net/texts/asp-cast128-1.1ita.htm

Informations:
You can download it here: http://www.paipai.net/texts/asp-cast128.zip
To contact me:
The component home page: http://www.paipai.net/texts/asp-cast128.htm

(C) & Disclaimer
This component is 100% free. You can disassemble, modify, destroy and drop it without any restriction. Available on request the C++ source.
The software came "as is", without any type of warranty.

The Cast128 implementation used in this component was made outside the USA.

Index

1. Installation
2. Documentation

 

 

1. Installation

To install this component

1) copy the cast.dll file in any system folder (c:\windows or c:\winnt or c:\winnt\system32 or so)
2) run regsvr32.exe c:\winnt\system32\cast.dll (if the cast.dll is in the c:\winnt\system32 folder )
3) Use it.

To uninstall this component

1) there isn't a clean way to uninstall.
2) use regedit.exe and search this strings:
B11567EB-EF87-4BDD-9070-581EAB099A08
2121B8E7-E209-410D-AF86-20CBD9A96527
12BBFB97-0AEC-4837-8061-12CA8EAD166B
3) delete anything about that strings
4) delete the cast.dll file

2. Documentation

This component use Cast128 to encrypt data. Cast is a simmetric algorithm, so you must use the same key to encrypt and decrypt data..
Strings are the only valid input.
The encrypted output is base64 coded, so you can treat it as a simple ASCII string.

This component was created to encrypt importants data sent with cookies.
It is named "cast" ant contains only a class called "chipher".

To create an istance of the chipher class use the simbolic name "cast.chipher" or the CLSID {12BBFB97-0AEC-4837-8061-12CA8EAD166B}

To create an instance using VB/VBS:
set objCast = createobject("cast.chipher")

The chipher class have only two methods, encode and decode.

 

The encode method is defined as:
VARIANT encode( VARIANT key, VARIANT inData)

Parameters:

key

a VARIANT containing a string. This string represent the encription/decriprion key.
Must be a String, or no output will be generated
Any ASCII character should be valid, except that represented by code 0 (zero or NULL char)

inData a VARIANT containing a string. This string represent the data to be encrypted
Must be a String, or no output will be generated
Any ASCII character should be valid, except that represented by code 0 (zero or NULL char)

Returned value:
A String that represents the data in base64. The string only contains that chars:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+/
and the special termination char '='

The string is contained in a VARIANT type.

 

The decode method is defined as:
VARIANT decode( VARIANT key, VARIANT inData)

Parameters:

key
a VARIANT containing a string. This string represent the encription/decriprion key.
Must be a String, or no output will be generated.
The key Must be the same you used to encrypt the data.
Any ASCII character should be valid, except that represented by code 0 (zero or NULL char)
inData a VARIANT containing a string. This string represent the data to be decrypted.
Must be a String, or no output will be generated.
Only Base64 characters are valid:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+/
and the special termination char '='

Returned value:
A String that represents the original data. The string is contained in a VARIANT type.

 

Midori, Paipai Networks, Dec 2000.