I am preparing for the GDPR.
So I try to encrypt and decrypt a word file.
But I get an error if I try to reopen the decypted word file.
Could someone please help me.
Best regards,
Otto
- Code: Select all Expand view
- // New FiveWin Encrypt() and Decrypt() functions
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local cText := ""
local cTextDecryp := ""
local cLetter := "c:\fwh\samples\InfoCardDemo.docx"
local cTextenc := ""
local cDSt := "c:\fwh\samples\InfoCardDemo.enc"
local cLetterNew := "c:\fwh\samples\InfoCardDemoNew.docx"
*----------------------------------------------------------
cText := memoread( cLetter )
cTextenc := Encrypt( cText, "User1Key" )
memowrit( cDSt, cTextenc )
? "Doc-Datei verschlüsselt"
cText := memoread( cDSt )
cTextDecryp = Decrypt( cText , "User1Key" )
memowrit( cLetterNew, cTextDecryp )
? "Doc-Datei entschlüsselt"
return nil
//----------------------------------------------------------------------------//