Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/04/2009 at 17:12, xxxxxxxx wrote:
User Information: Cinema 4D Version: 11 Platform: Language(s) :
--------- Heyho,
I have a problem with the AES class. I just tried out to encrypt a simple char array. This works fine with small arrays but when I try to encrypt bigger char arrays the result is cut.
The array: "This is an example for a 100.000 digits char array 12345...." so the array is encrypted and decrypted and this is the result: "This is an example for a 3000 dig"
I don't know whats the reason why the result is cut but I guess I did something wrong with the block size, even its a very simple to use class. Is there any example outside?
Thanks in advance, Sebastian
On 20/04/2009 at 04:07, xxxxxxxx wrote:
any ideas how to handle this class?
On 21/04/2009 at 02:49, xxxxxxxx wrote:
Here is a simple example how to encrypt and decrypt a block of text for instance.
> \> AutoAlloc<AES> aes; \> if (!aes) \> { \> bDelete(text); \> return FALSE; \> } \> \> aes->Init(128,128); \> \> VLONG encdatalen = AES::CalcEncryptedDataSize(128, length); \> \> aes->Encrypt(text, encdatalen, "mypassword"); \> \> //do something with encrypted data \> \> aes->Decrypt(text, encdatalen, "mypassword"); \>
\> AutoAlloc<AES> aes; \> if (!aes) \> { \> bDelete(text); \> return FALSE; \> } \> \> aes->Init(128,128); \> \> VLONG encdatalen = AES::CalcEncryptedDataSize(128, length); \> \> aes->Encrypt(text, encdatalen, "mypassword"); \> \> //do something with encrypted data \> \> aes->Decrypt(text, encdatalen, "mypassword"); \>
Important is to get the right length of the data block with AES::CalcEncryptedDataSize().
cheers, Matthias
On 21/04/2009 at 04:00, xxxxxxxx wrote:
Thank you - works fine. Yes, you are right, I just passed the wrong length of the text (was different because of the encoding).