Re: Encrypt & Compression a file failed (General questions)
Hi
program code as follow:
Private Sub cmdDecrypt_Click()
Dim srcfile As New FileBlob
Dim destfile As New FileBlob
Set oCrypt = New wodCryptCom
If Check1.Value = 1 Then
oCrypt.Type = TripleDES
oCrypt.InitVector = 123
oCrypt.SecretKey = Now
Else
oCrypt.Type = None
End If
If Check1.Value = 1 Then
oCrypt.Optimized = True
Else
oCrypt.Optimized = False
End If
oCrypt.Compression = GZipCompression
srcfile.FileName = txtSourceDec.Text
destfile.FileName = txtDestDec.Text
oCrypt.Decrypt srcfile, destfile
Set srcfile = Nothing
Set destfile = Nothing
MsgBox Decryption Complete
End Sub
Private Sub cmdEncrypt_Click()
Dim srcfile As New FileBlob
Dim destfile As New FileBlob
Dim a As IStream
Set oCrypt = New wodCryptCom
If Check1.Value = 1 Then
oCrypt.Type = TripleDES
oCrypt.InitVector = 123
oCrypt.SecretKey = Now
Else
oCrypt.Type = None
End If
oCrypt.Compression = GZipCompression
If Check1.Value = 1 Then
oCrypt.Optimized = True
Else
oCrypt.Optimized = False
End If
srcfile.FileName = txtSource.Text
destfile.FileName = txtDest.Text
oCrypt.Encrypt srcfile, destfile
MsgBox Encyption Complete
End Sub