Products » dgEncrypt User Guide

Method:  Cipher::DecryptFile

DecryptFile(CipherText, PlainText)

Given the pathname of a file produced by a call to EncryptFile, the DecryptFile method will decrypt the file, and write the resulting plain text to the location specified in the PlainText argument. This location may be identical to that given in the CipherText argument, in which case the file will be decrypted in-place, with the plain text version overwritting the original cipher text.
 
CipherText
The CipherText argument is the full pathname of the file to decrypt.
 
PlainText
The PlainText argument is the full pathname of the file to which the plain text should be written.
 
Example:
Dim strKeyFile As String
Dim strMailFile As String
Dim objKey As DGENCRYPTLib.Key
Dim objCipher As DGENCRYPTLib.Cipher


' . . .


Set objKey = New DGENCRYPTLib.Key
objKey.ReadKeyFile strKeyFile

' decrypt the file in-place
Set objCipher = New DGENCRYPTLib.Cipher
objCipher.SetKey objKey
objCipher.DecryptFile strMailFile, strMailFile


' . . .


Set objCipher = Nothing
Set objKey = Nothing