Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Need to encrypt text output

 Post Reply Post Reply
Author
Kraemer Guenter View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 May 2014
Posts: 128
Post Options Post Options   Quote Kraemer Guenter Quote  Post ReplyReply Direct Link To This Post Topic: Need to encrypt text output
    Posted: 07 Jan 2017 at 3:30pm
Logging is fine, but I have to log license and other sensitive information additional, so I need to encrypt the output. Is there any way to capture the data before they are written, so I can apply encryption to them? I only need to out out in plain text.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3202
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 2017 at 4:35pm
Hi,

To accomplish this you'll need to write your own outputhandler or use the OnOutput event that is triggered when a log event occurs. There is currently no alternative to encrypt the content before it is sent to one of the attached outputhandlers. Creating your own encrypted outputhandler based on an existing one should be fairly easy. You could also start from a new outputhandler unit.
Back to Top
Kraemer Guenter View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 May 2014
Posts: 128
Post Options Post Options   Quote Kraemer Guenter Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jan 2017 at 1:39pm
I tried to use the aes component (tms) in the TMSLoggingTextOutputHandler.pas, and the moment I add aes:=TAESEncryption.Create; my program just silently exit without exception or anything.
Even a breakpoint at that code wont stop it from quitting.

I added in the TMSLoggingTextOutputHandler.pas the units:
MiscObj, AESObj, RSAObj, ECCObj, SPECKOBj, SalsaObj, HashObj

No issue, it runs.

Then I added aes:=TAESEncryption.Create; to the function TTMSLoggerTextOutputHandler.GetOutputText and it wont run any longer and immediately quit.

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3202
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jan 2017 at 1:43pm
Hi, 

Did you try this outside of any logging output handler just to be sure the code executes correctly?
Back to Top
Kraemer Guenter View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 May 2014
Posts: 128
Post Options Post Options   Quote Kraemer Guenter Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 2017 at 2:15am
What do you mean with "outside of any logging output handler"? The AES? Yes, it works fine in any other module.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3202
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 2017 at 9:56am
Hi, 

It's unclear exactly what is going wrong, are you getting an exception, invalid pointer or access violation or similar issues?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down