|
The component uses Cast128 and Aes as encryption algorithms. Cast
and Aes are "symmetric" algorithms so you need
to use the same key in order to encrypt and decrypt data.
Some methods generate the base64 encoded data:
this allows to use the output as an ASCII string.
The component can be used also as a fast Base64 codec.
As input you can use string or Array of bytes. All the Array that some
method output are compatible with the type accepted from
Response.BinaryWrite ASP function.
Finally, there are two methods ( toBArray, toString
) that allow to convert Array of integer values in string and string
or the Array of integer values in Array of bytes.
The component has been created originally in order encrypt important
data sent through cookies (like login and password).
It is composed by 3 ActiveX objects: Cipher, Base64 and Md5.
The Cipher object contains all methods to encrypt and decrypt data.
The Base64 object is a base64 codec.
The Md5 is a simple MD5-Hash
implementation. It can be used just to make the Hash of a file.
The MidoriCrypt ActiveX Component contains also the cipher object
that was contained in my old Cast128 Component. So if you need to be
compatible with this component, you can use MicoriCrypt and there is
no need to
change existing code.
Object's ProgIDs:
MidoriCrypt.Cipher or CLSID {4F59C090-F8FC-4ACD-83F3-A7A249E4950B} to
instantiate new Cipher object
MidoriCrypt.Bas64 or CLSID {829AC085-CBF0-4AC8-B2F7-6CC1764316F2}
to instantiate the Base64 object
MidoriCrypt.Md5 or CLSID {88AB77C8-AD7E-46A0-9556-9800A12532F7} to
instantiate the Md5 object
Cast.cipher or MidoriCrypt.cipherLegacy or {1A2087AA-957C-41FF-BC6E-57E6DC26C54B}to
instantiate old Cipher object
Creating instances in VisualBasic/VBScript:
Dim objCast
set objCast = CreateObject("cast.cipher") ' old Cast128 interface
Dim objMidoryCipher
set objMidoryCipher = CreateObject("MidoriCrypt.Cipher ")
' new Cipher
interface
Dim objMidoryMd5
set objMidoryMd5 = CreateObject("MidoriCrypt.Md5") ' Md5
interface
2.1 MidoriCrypt Cipher Object methods:
1) BSTR Cast128Encode(VARIANT key, VARIANT
inData)
2) VARIANT Cast128Encode2ByteArray(VARIANT key, VARIANT inData)
3) BSTR Cast128Decode(VARIANT key, VARIANT inData)
4) VARIANT Cast128Decode2ByteArray(VARIANT key,
VARIANT inData)
5) BSTR AesEncode(VARIANT
key, VARIANT inData)
6) VARIANT AesEncode2ByteArray(VARIANT
key, VARIANT inData)
7) BSTR AesDecode(VARIANT
key, VARIANT inData)
8) VARIANT AesDecode2ByteArray(VARIANT
key,
VARIANT inData)
2.1.1 Cast128Encode
BSTR Cast128Encode(VARIANT
key, VARIANT inData) Encrypt a string or an array of bytes using the key specified in key.
Return value id a base64 string. Use Cast128Encode2ByteArray if you
want to encrypt to a binary byte Array insead of get a base 64 output.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to
use a string or a byte array.
If key is a String, It will be used as unicode if not is passed
a ASCII/Multibyte string.
|
| inString |
a VARIANT containing the data to encrypt.
It should be a string or a byte array. Any other type will be
converted to a string before processing.
Note that strings are always handled as Unicode. |
Returned Value:
A BSTR (String in Visual Basic) containing a base64 string. It contains only
these characters:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+ /
and the special termination character ' = '
2.1.2 Cast128Encode2ByteArray
VARIANT Cast128Encode2ByteArray(VARIANT
key, VARIANT inData)
Encrypt a string or an array of bytes specified in inData using
the key specified
in key.
Return value id a base64 string. Use Cast128Encode if you
want to base64 string output.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string
or a byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
|
| inString |
a VARIANT containing the data to encrypt.
It should be a string or a byte array. Any other type will be converted
to a string before processing.
Note that strings are always handled as Unicode. |
Returned Value:
A VARIANT containing the raw encrypted data.
2.1.3 Cast128Decode
BSTR Cast128Decode(VARIANT
key, VARIANT inData)
Decrypt data previously encrypted using Cast128Encode or Cast128Encode2ByteArray,
specified in inData, using the key specified
in key. Return value is the original data contained in a string.
You should use this function if original data was a string.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string
or a byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
|
| inData |
a VARIANT containing the data to decrypt.
It can be the output of Cast128Encode or Cast128Encode2ByteArray functions:
a base64 string or a raw byte array. |
Returned Value:
A BSTR (String in Visual Basic) containing the original data.
2.1.4 Cast128Decode2ByteArray
VARIANT Cast128Decode2ByteArray(VARIANT key, VARIANT inData)
Decrypt data previously encrypted using Cast128Encode or Cast128Encode2ByteArray,
specified in inData, using the key specified
in key. Return value is the raw original data contained in a Byte Array.
You should use this function if original data was a byte array.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string
or a byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
|
| inData |
a VARIANT containing the data to decrypt.
It can be the output of Cast128Encode or Cast128Encode2ByteArray functions:
a base64 string or a raw byte array. |
Returned Value:
A VARIANT containing the original raw data as Byte Array.
2.1.5 AesEncode
BSTR AesEncode(VARIANT key, VARIANT inData)
Encrypt a string or an array of bytes using the AES algorithm and
the key specified in key.
Return value id a base64 string. Use AesEncode2ByteArray if you
want to encrypt to a binary byte Array insead of get a base 64 output.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string
or a byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
NOTE: if the key lenght isn't 16, 24 or 32, the key will be padded
with spaces (or zeroes if the key is passed as an Array)
|
| inString |
a VARIANT containing the data to encrypt.
It should be a string or a byte array. Any other type will be converted
to a string before processing.
Note that strings are always handled as Unicode. |
Returned Value:
A BSTR (String in Visual Basic) containing a base64 string. It contains only
these characters:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+ /
and the special termination character ' = '
2.1.6 AesEncode2ByteArray
VARIANT AesEncode2ByteArray(VARIANT key, VARIANT inData)
Encrypt a string or an array of bytes specified in inData using
AES algorithm and
the key specified in key. Return value id a base64 string. Use AesEncode if you
want to base64 string output.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string or a
byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
NOTE: if the key lenght isn't 16, 24 or 32, the key will be padded with spaces
(or zeroes if the key is passed as an Array)
|
| inString |
a VARIANT containing the data to encrypt.
It should be a string or a byte array. Any other type will be converted
to a string before processing.
Note that strings are always handled as Unicode. |
Returned Value:
A VARIANT containing the raw encrypted data.
2.1.7 AesDecode
BSTR AesDecode(VARIANT key, VARIANT inData)
Decrypt data previously encrypted using AesEncode or AesEncode2ByteArray,
specified in inData, using AES algorithm and
the key specified in key.
Return value is the original data contained in a string.
You should use this function if original data was a string.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string or a
byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
NOTE: if the key lenght isn't 16, 24 or 32, the key will be padded with spaces
(or zeroes if the key is passed as an Array)
|
| inData |
a VARIANT containing the data to decrypt.
It can be the output of Cast128Encode or Cast128Encode2ByteArray functions:
a base64 string or a raw byte array. |
Returned Value:
A BSTR (String in Visual Basic) containing the original data.
2.1.4 AesDecode2ByteArray
VARIANT AesDecode2ByteArray(VARIANT key, VARIANT inData)
Decrypt data previously encrypted using AesEncode or AesEncode2ByteArray,
specified in inData, using the AES algorithm and
key specified in key.
Return value is the raw original data contained in a Byte Array.
You should use this function if original data was a byte array.
Parameters:
key
|
a VARIANT containing a the key to be used to encrypt.
It can be almost any variant sub type, but it is better to use a string or a
byte array.
If key is a String, It will be used as unicode if not is passed a ASCII/Multibyte
string.
NOTE: if the key lenght isn't 16, 24 or 32, the key will be padded with spaces
(or zeroes if the key is passed as an Array)
|
| inData |
a VARIANT containing the data to decrypt.
It can be the output of Cast128Encode or Cast128Encode2ByteArray functions:
a base64 string or a raw byte array. |
Returned Value:
A VARIANT containing the original raw data as Byte Array.
2.2 MidoriCrypt Base64 Object methods:
1) VARIANT b64StrEnc(VARIANT
inString)
2) VARIANT b64StrDec(VARIANT
inBase64String)
3) VARIANT b64ArrayEnc(VARIANT
inArray)
4) VARIANT b64ArrayDec(VARIANT
inBase64String)
All methods of this object have same signature as corresponding methods
contained in Cast128 Component
compatible Cipher Object.
2.3 MidoriCrypt
Md5 Object methods:
1) BSTR FileMd5(BSTR inFile)
2) BSTR FileMd5OpenSSLOutput(BSTR inFile)
2.3.1 FileMd5
BSTR FileMd5(BSTR
inFile)
Calculate hte HASH of the file specified in inFile.
Parameters:
| inFile |
a BSTR (String in Visual Basic) containing the path of the
input file. |
Returned Value:
A BSTR (String in Visual Basic) containing the HASH. The stirng is in Hexadecimal
ASCII format.
Example: AABBCCDDEEFF11223344556677889900
2.3.2 FileMd5OpenSSLOutput
BSTR FileMd5OpenSSLOutput(BSTR inFile)
The only difference with the FileMd5 function is the output format, that is similar
to
the OpenSSL one:
An Hexadecimal
ASCII string with a separator character ":".
Example: AA:BB:CC:DD:EE:FF:11:22:33:44:55:66:77:88:99:00
2.4 Cast128 Component compatible Cipher
Object methods:
1) VARIANT cast128encode(VARIANT
key, VARIANT inString)
2) VARIANT cast128decode(VARIANT
key, VARIANT inBase64String)
3) VARIANT cast128ArrayEnc(VARIANT
key, VARIANT inArray)
4) VARIANT cast128ArrayDec(VARIANT
key, VARIANT inArray)
5) VARIANT b64StrEnc(VARIANT
inString)
6) VARIANT b64StrDec(VARIANT
inBase64String)
7) VARIANT b64ArrayEnc(VARIANT
inArray)
8) VARIANT b64ArrayDec(VARIANT
inBase64String)
9) VARIANT encode(VARIANT
key, VARIANT inString)
10) VARIANT decode(VARIANT
key, VARIANT inBase64String)
11) VARIANT toBArray(VARIANT
inData)
12) VARIANT toString(VARIANT
inArray)
2.4.1. cast128encode
VARIANT cast128encode(VARIANT key, VARIANT inString)
Encrypt a string using the key specified in key. It gives return
a base64 string. Use cast128ArrayEnc if you
want to encrypt an Array.
Parameters:
key
|
a VARIANT containing a string that represents the encryption/decryption
key.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from
the 0 (zero or NULL)
|
| inString |
a VARIANT containing the string to encrypt.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from the
0 (zero or NULL) |
Returned Value:
A VARIANT containing a base64 string. It contains only these characters:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+ /
and the special termination character ' = '
The string returned is contained in a VARIANT.
2.4.2. cast128decode
VARIANT cast128decode(VARIANT key, VARIANT inBase64String)
It decrypts a string generated previously from cast128encode(), using
the key specified in key. It gives back a string representing
the original data. If you want to decrypt an Array it uses cast128ArrayDec
Parameters:
key
|
a VARIANT containing a string that represents the encryption/decryption
key.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from the
0 (zero or NULL) |
| inBase64String |
a VARIANT containing the data to be decrypted. It must contain
a string previously generated by cast128encode()
|
Returned Value:
A VARIANT containing a string, that represent the original data.
2.4.3. cast128ArrayEnc
VARIANT cast128ArrayEnc(VARIANT key, VARIANT inArray)
Encrypt an array using the key specified in key. It gives back
an Array of bytes containing the encrypted data. If you want Encrypt
strings, use cast128encode
Parameters:
key
|
a VARIANT containing a string that represents the encryption/decryption
key.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from the
0 (zero or NULL) |
| inArray |
a VARIANT containing the array to encrypt. It must be an Array.
Every element should be a byte (unsigned 8 bit). The Array must
contain a number of elements that is multiple of 8, or no output
is generated (cast accept only blocks of 64 bit as input). |
Returned Value:
A VARIANT containing an Array of byte (unsigned 8 bit) that contains
the encrypted data; it is compatible with ASP method Response.BinaryWrite.
The number of elements is same of the the source Array.
For who is interested, the returned VARIANT is of type VT_ARRAY | VT_UI1
( try words " VARIANT AND VARIANTARG " in the MSDN, http://msdn.microsoft.com / .
2.4.4. cast128ArrayDec
VARIANT cast128ArrayDec(VARIANT key, VARIANT inArray)
It decrypts an Array of byte previously encrypted using cast 128 and
using the key specified in key. It return an Array containing
the original data. If you want to decrypt strings, use cast128decode.
Parameters:
key
|
a VARIANT containing a string that represents the encryption/decryption
key.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from the
0 (zero or NULL) |
| inArray |
a VARIANT containing the array to decrypt. It must be an Array.
Every element should be a byte (unsigned 8 bit). The Array must
contain a number of elements that is multiple of 8, or no output
is generated (cast accept only blocks of 64 bit as input).
|
Returned Value:
A VARIANT containing an Array of byte (unsigned 8 bit) that contains
the decrypted original data; it is compatible with ASP method Response.BinaryWrite.
The number of elements is same of the the source Array.
For who is interested, the returned VARIANT is of type VT_ARRAY | VT_UI1
( try words " VARIANT AND VARIANTARG " in the MSDN, http://msdn.microsoft.com / .
2.4.5. b64StrEnc
VARIANT b64StrEnc(VARIANT inString)
It codifies a string using base64. The output it is a base64 string.
If you want to codify Array, use b64ArrayEnc
Parameters:
| inString |
a VARIANT containing a string to be encoded.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from the
0 (zero or NULL) |
Returned Value:
A VARIANT containing a Base64 string.
2.4.6. b64StrDec
VARIANT b64StrDec(VARIANT inBase64String)
It decodes one tightens codified in base64. De you want to decodifcare
attay uses b64ArrayDec
Parameters:
| inBase64String |
a VARIANT containing a string that represents the base64 data
do be decoded.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from
the 0 (zero or NULL). Moreover the length must be multiple of
4, to be a valid base64 string, and must contain only the following
characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+ /
and the special termination character ' = '
|
Returned Value:
A VARIANT containing the original string data.
2.4.7. b64ArrayEnc
VARIANT b64ArrayEnc(VARIANT inArray)
It codifies an Array of bytes using base64. The output it is a base64
string.
If you want to codify strings, use b64StrEnc .
Parameters:
| inArray |
A VARIANT containing the data to codify. It must be an Array.
Every element must be a byte (unsigned 8 bit). |
Returned Value:
A VARIANT containing a Base64 string.
2.4.8. b64ArrayDec
VARIANT b64ArrayDec(VARIANT inBase64String)
It decodes a base64 string and places decoded data in an Array of bytes
(unsigned 8 bit). If you want a string as output use b64StrDec.
Parameters:
| inBase64String |
a VARIANT containing a string that represents the base64 data
do be decoded.
It must necessarily to be a string, or no output will be generated.
Any character ASCII is valid, except that one represented from
the 0 (zero or NULL). Moreover the length must be multiple of
4, to be a valid base64 string, and must contain only the following
characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz0123456789+ /
and the special termination character ' = '
|
Returned Value:
A VARIANT containing an Array in which they are placed the original
decoded data; it is compatible with ASP method response.BinaryWrite.
For who is interested, the returned VARIANT is of type VT_ARRAY | VT_UI1
( try words " VARIANT AND VARIANTARG " in the MSDN, http://msdn.microsoft.com / .
2.4.9. encode
VARIANT encode (VARIANT key, VARIANT
inString)
A alias of cast128encode
2.4.10. decode
VARIANT decode (VARIANT key, VARIANT
inBase64String)
A alias of cast128decode
2.4.11. toBArray
InData VARIANT toBArray(VARIANT)
It converts a string to an Array of bytes. Such Array is usable with
the other methods of the cipher class (ex. with b64ArrayEnc
) and with the ASP method Response.BinaryWrite. If you want to convert
an Array to a string, use the method toString.
Parameters:
| inData |
a VARIANT containing a string to convert, or an Array of integer
values (with or without sign).
|
It gives back:
A VARIANT containing an Array of byte, compatible with ASP method Response.BinaryWrite.
For who is interested, the returned VARIANT is of type VT_ARRAY | VT_UI1
( try words " VARIANT AND VARIANTARG " in the MSDN, http://msdn.microsoft.com / .
2.12. toString
VARIANT toString(VARIANT inArray)
It converts an Array of integer value in a string. If you want to convert
a string to an Array of Bytes use the method toBArray
Parameters:
| inArray |
a VARIANT containing an Array of integer values (with or without
sign).
For who is interested, the returned VARIANT is of type VT_ARRAY
| VT_UI1 ( try words " VARIANT AND VARIANTARG " in the MSDN, http://msdn.microsoft.com / .
|
It gives back:
A VARIANT containing a string.
3. Examples of use
Cast Encrypt/Decrypt of a string in Visual Basic:
Set MidoriCryp = CreateObject("MidoriCrypt.Cipher")
Dim tkey As Variant
Dim original As Variant
Dim encodedText As Variant
Dim decodedText As Variant
tkey = "the Key"
original = "Encoded Text"
encodedText = MidoriCryp.cast128encode(tkey, original)
decodedText = MidoriCryp.cast128decode(tkey, encodedText)
msgbox("Dati originali:" & original & vbNewline & "Dati criptati: " & encodedText & vbNewline & _
"Dati decriptati: " & decodedText)
Set MidoriCryp = Nothing
Cookies with ASP VBScript:
Setting of an encrypted cookie
set MidoriCrypt = server.createObject("MidoriCrypt.Cipher")
response.cookies("CookieName")("server") = MidoriCrypt.cast128encode("pass", "www.anon.net" )
response.cookies("CookieName")("login") = MidoriCrypt.cast128encode("pass", "myname")
response.cookies("CookieName")("password") = MidoriCrypt.cast128encode("pass","mypassword")
Response.Cookies("CookieName").Expires = dateadd("d",10,date)
Response.Cookies("maiCookieNamelclient").Domain = "www.anon.net"
Response.Cookies("CookieName").Path = "/"
Response.Cookies("CookieName").Secure = false
Getting an encrypted cookie
set MidoriCrypt = server.createObject("MidoriCrypt.Cipher")
encodedLogin = request.cookies("CookieName")("login")
encodedPassword = request.cookies("CookieName")("password")
encodedServer = request.cookies("CookieName")("server")
Login = MidoriCrypt.cast128decode("pass", encodedLogin )
Password = MidoriCrypt.cast128decode("pass", encodedPassword )
MyServer = MidoriCrypt.cast128decode("pass", encodedServer )
Base64 encoding/decoding of an array in ASP VBScript:
set Base64Codec = server.createObject("MidoriCrypt.Base64")
OriginalArray = Array(1, 3, 90, 23, 66, 3)
strB64EncodedArray = Base64Codec.b64ArrayEnc(OriginalArray)
DecodedArray = Base64Codec.b64ArrayDec(strB64EncodedArray)
response.write("Original Data: " & OriginalArray(0) & ", " & OriginalArray(1) & _
", " & OriginalArray(2) & ", " & OriginalArray(3) & ", " & OriginalArray(4) & _
", " & OriginalArray(5) & )
response.write("Encoded Data Base64: " strB64EncodedArray & )
response.write("Decode Data: " & DecodedArray(0) & ", " & DecodedArray(1) & _
", " & DecodedArray(2) & ", " & DecodedArray(3) & ", " & DecodedArray(4) & _
", " & DecodedArray(5) & )
Cast encrypt/decrypt of an array to a RAW byte array encrypted data, in ASP VBScript:
set Base64Codec = server.createObject("MidoriCrypt.Base64")
set MidoriCrypt = server.createObject("MidoriCrypt.Cipher")
OriginalArray = Array(1, 3, 90, 23, 66, 3)
Key = "the Key"
Cast128EncryptedArray = MidoriCrypt.Cast128Encode2ByteArray(Key,OriginalArray)
DecryptedArray = Base64Codec.Cast128Decode2ByteArray(key, Cast128EncryptedArray)
response.write("Original Data: " & OriginalArray(0) & ", " & OriginalArray(1) & _
", " & OriginalArray(2) & ", " & OriginalArray(3) & ", " & OriginalArray(4) & _
", " & OriginalArray(5) )
response.write("Encrypted data: " & Cast128EncryptedArray(0) & ", " & Cast128EncryptedArray(1) & _
", " & Cast128EncryptedArray(2) & ", " & Cast128EncryptedArray(3) & ", " & _
Cast128EncryptedArray(4) & ", " & Cast128EncryptedArray(5) )
response.write("Decrypted Data: " & DecryptedArray(0) & ", " & DecryptedArray(1) & _
", " & DecryptedArray(2) & ", " & DecryptedArray(3) & _
", " & DecryptedArray(4) & ", " & DecryptedArray(5))
4. History
| 1.0 |
A reimplemenation of my Cast128 Component using ATL.
This version should work well using .NET Framework |
5. Structure of the cast128encode output
New Chiper Object output format:
Encrypted Data is always encrypted
in CBC mode, with the Initialization Vector (IV) zero-filled.
Before encryption, data is always padded using ISO padding for Simmetric
Encryption.
The padded data have the following format:
DataBlock1 + DataBlock1 + ... + DataBlockN + PaddingBlock
At moment we are using just Cast128 algorithm, so the block size
is always 8 bytes.
The padding block contains last bytes of the data to encode. The
padding block can contain 0 to 7 bytes of data. Last byte of the
padding block contain the number of bytes contained in the padding
block; so last byte can assume values from 0 to 7. Unused bytes
in the padding block are filled with Zeroes.
Note that the padding block is always present, also if the input
data length is multiple of block size (so there is no data in the
padding block)
The padded data is then Encrypted. The Cast128Encode function will
also encode the encrypted raw data to a Base64 String.
Note, when encrypting string: strings are always
handled as unicode, also if you are using pure ASCII or Multybyte
strings.
Old Cast128 Componet output format:
The cast128encode method transforms input string in an Array of unsigned
char. After that it codifies this Array using base64. If the obtained
string have an uneven number of blocks of 4 byte (or base64 blocks),
4 characters of ' = ' are added to the end of the string. That assures
that the string contains a multiple number of elements of 8. That String
is encrypted with the cast128 algorithm. The output it comes newly
codified in base64 in order obtaining an ASCII string. The output
generated is
large approximately 50% in more than the input. In the next version
I will take care to change the algorithm to lower the space occupied
by the output, maintaining in any case a compatibility with old versions.
6. Note about the Base64
The base64 codifies data in a way that it can be represented with a printable
subset ASCII characters.
The characters used are 65 (64 for the rapresentation, plus a special
one):
ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz0123456789+ /
and the special character ' = ', that is used like termination character
in some cases
Known Bugs
If you found a bug, please report it to
Listed on:
Midori, Paipai Networks, Jan
2001. |