Files locked after encryption, until objects destr - WeOnlyDo Discussion board

Files locked after encryption, until objects destr (wodCrypt)

by DanCooperstock, Thursday, January 12, 2012, 15:28 (4487 days ago)

When I'm using the ActiveX version of wodCrypt to encrypt files, using FileBlob objects, I have found that the encryped file is locked until I destroy the ActiveX objects that my code created. (I'm not sure if it's the encryption object, and/or the FileBlob objects, that are relevant here.)

Is this expected? Could there not be an automatic disconnect in the FileBlobs after an encryption is completed, and/or a method to disconnect from the files?

Re: Files locked after encryption, until objects d

by woddrazen, Thursday, January 12, 2012, 15:44 (4487 days ago) @ DanCooperstock

Hi Dan,


Can you maybe check which version of wodCrypt you are using? You can check version using wodCrypt Version Property.
[code]MsgBox crypt1.Version[/code]
Also, did you maybe try to duplicate this issue using our samples? Does it occur there also? You can find samples inside component Samples folder.

Let us know how it goes.


Regards,
Drazen

Re: Files locked after encryption, until objects d

by DanCooperstock, Thursday, January 12, 2012, 16:04 (4487 days ago) @ woddrazen

Hi Dan, Can you maybe check which version of wodCrypt you are using?

It's 2.1.4.94. Is this something that might have been changed after that?

This isn't something I can necessarily reliably replicate, but I know I had problems with it in the past, because I just happened to notice some old code that does the disconnect, with a comment about why I was doing it.

I just wanted to know whether this was something you had fixed since the version I was using (I didn't see anything about it in the release notes) or if you might address it in the future.

By the way, when I first submitted this reply, I seem to have gotten the Captcha wrong, and my submission was lost, because your Back link just went to the main forum page! If you have any control over this, you might want to revisit that process.

Re: Files locked after encryption, until objects d

by wodDamir, Thursday, January 12, 2012, 16:18 (4487 days ago) @ DanCooperstock

Dan,

I would suggest trying out the latest version. We did see a problem with locked files, which was resolved.

Regards,
Damba

Re: Files locked after encryption, until objects d

by DanCooperstock, Thursday, January 12, 2012, 16:40 (4487 days ago) @ wodDamir

Dan,

I would suggest trying out the latest version. We did see a problem with locked files, which was resolved.

Regards,
Damba

OK, I am now on 2.2.0.98. However, the problem is still there. Immediately after calling iole_crypt.Encrypt(infileBlob, outfileBlob), I try opening both files with read/write locking, and I cannot do that for either one.

Surely that is not how it should behave? Or, as I say, should there not be some disconnect option in the FileBlobs?

Re: Files locked after encryption, until objects d

by DanCooperstock, Thursday, January 12, 2012, 16:45 (4487 days ago) @ DanCooperstock

Immediately after calling iole_crypt.Encrypt(infileBlob, outfileBlob), I try opening both files with read/write locking, and I cannot do that for either one.

I found a work-around. If immediately after the Encrypt() call, I do:

iole_infile.FileName =
iole_outfile.FileName =

the files are then unlocked. Perhaps your docs could reflect something about that requirement? (Of course, it's only a requirement if you aren't immediately destroying the objects, but it's not obvious that you should have to do so. Perhaps I'd prefer to create the objects, and just keep them around for whenever the program needs to do encryption.)

Re: Files locked after encryption, until objects d

by wodDamir, Thursday, January 12, 2012, 17:00 (4487 days ago) @ DanCooperstock

Dan,


I just tried the following:

[code]Dim srcfile As New FileBlob
Dim destfile As New FileBlob

srcfile.FileName = H:vmwareFile1.txt
destfile.FileName = H:vmwareFileOut.zip

wodCrypt1.Type = Blowfish
wodCrypt1.SecretKey = Now
wodCrypt1.Compression = GZipCompression
wodCrypt1.Optimized = False
wodCrypt1.Encrypt srcfile, destfile[/code]

Once it was done encrypting, I tried deleting both files, and it succeeded.

However, blob objects should be destroyed or set to when done using them. You can always recreate them later.

Regards,
Damba

Re: Files locked after encryption, until objects d

by flogger123, Thursday, January 26, 2012, 15:39 (4473 days ago) @ wodDamir

got the same problem [image] [image]

Re: Files locked after encryption, until objects d

by woddrazen, Thursday, January 26, 2012, 15:48 (4473 days ago) @ flogger123

Hi,


Did you maybe tried Damba suggestion? Does it work if you try something like that or your still received same issue?


Regards,
Drazen