login about faq

Trying to use CkEmail.AesEncrypt method (with password string), and resulting email is not encrypted, although success is returned.

This is using the C++ Linux library.

asked Jan 24 at 15:35

W_K's gravatar image

W_K
11


I haven't used this function, so I'm just guessing here, but when do you call AesEncrypt? If you call it after setting your body text, attachments, etc... try calling it before, or if you already call it before, try calling it after.

If that doesn't help, could you post some sample code?

Also, are you using the latest version of the library?

link

answered Jan 24 at 20:40

jpbro's gravatar image

jpbro ♦
1.1k2618

I call it when the email is complete, of course. Doesn't make sense (to me) to try to encrypt before everything is ready to go.

I'm using 9.5.0-x86_64.

link

answered Jan 24 at 23:45

W_K's gravatar image

W_K
11

edited Jan 24 at 23:53

I think jpbro makes a good point. Perhaps the AesEncrypt method just sets a property of the CkEmail (not actually encrypting) and methods like setTextBody check/use that property to do the actual encryption. It's worth a try.

(Jan 25 at 00:02) Gert ♦

Ahh, I see!

It is a streaming cypher. Makes sense. I imagine it's always padding the last block (if necessary) until something else comes in (if it works that way).

I'll give it a try.

Thanks.

link

answered Jan 25 at 00:15

W_K's gravatar image

W_K
11

Tried it both ways.

1)

CkEmail email; 
email.AesEncrypt("password");
email.LoadEml("Test.eml"); // Properly formatted, with attachments. 
email.SaveEml("Test-enc.eml");

2)

CkEmail email; 
email.LoadEml("Test.eml"); // Properly formatted, with attachments. 
email.AesEncrypt("password");
email.SaveEml("Test-enc.eml");

Neither test-enc.eml files were encrypted.

link

answered Jan 25 at 01:03

W_K's gravatar image

W_K
11

I'll have a look. This functionality should already have been in Chilkat's QA test suite and automatically tested prior to every new version release -- may be something was amiss...

link

answered Jan 25 at 08:52

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

I tested it, and everything worked fine for me. The resultant email (after calling AesEncrypt) will contain the same top-level unencrypted header, but all message bodies, sub-parts (related parts, attachments, attached messages, etc.) will be condensed into a single AES encrypted blob that is base64 encoded.

Maybe the confusion is that you expected the top-level header to also be encrypted?

link

answered Jan 25 at 09:57

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×65
×33
×17
×14

Asked: Jan 24 at 15:35

Seen: 545 times

Last updated: Jan 25 at 09:57

powered by OSQA