Question: I’ve been using the AES erncryption stuff, now I have a need to encrypt/decrypt TIF files, PDF, other binary, and plan to use Chilkat Crypt (for VB6).
One thing that has me mightily confused is the choice of an encoding scheme like Unicode etc.
What do I use when I am going to be using ckEncryptfile and decryptfile on binary files?
Also, why is there an encoding schene at all? Doesn’t AES just encrypt/decrypt binary bytes?
PS> I am planning to use AES/Rijndael with FIPS-1 padding.
Answer:The Charset property only comes into play for methods that accept string arguments or return strings. If you are passing a VB6 string to EncryptString for example, you are passing a Unicode string (2 bytes per character). If the string is long, and you know that it only contains us-ascii and/or latin-1 characters, you may wish to specify a Charset of "iso-8859-1″ so that you are encrypting 1-byte/character. Internal to Chilkat Crypt, your Unicode string will first be converted to the Charset and then encrypted. (For methods that encrypt binary data or files, the Charset property is ignored.)
Likewise, if you are decrypting to return a string, the result (in VB6) cannot be anything other than a Unicode string. If a C++ program (for example) encrypts an iso-8859-1 string (1-byte/char), the Chilkat component needs to know that after decryption it should convert from iso-8859-1 bytes to Unicode so it can return a VB6 string.
The CkEncryptFile and CkDecryptFile treat all files (even text) as binary bytes, and the Charset property is ignored.