Belini

Prevent files from being copied

41 posts in this topic

Is there any way to prohibit any kind of file copying while my program is open?

I have encrypted files that are released by my program at certain times and I need to prevent them from being copied when they are being used by my program without encryption!

Share this post


Link to post
Share on other sites



45 minutes ago, Belini said:

Is there any way to prohibit any kind of file copying while my program is open?

I have encrypted files that are released by my program at certain times and I need to prevent them from being copied when they are being used by my program without encryption!

Hi @Belini:)

I was looking at this, but I didn't manage to lock some files I was working on...

I think that, to lock a file from copying, you should work on Files/Folders permissions...

Something like:
- While your script is running, so set 0 the permission to copy, delete, move... a file;
- As your script is not running anymore, set 1 the permission to copy, delete, move... a file.

Hope that helps :)

 


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

What about setting their attribute to hidden, or dumping them into a buried directory where the end user wouldn't think to look? You know that with AutoIt you are not going to get 100% security.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Quote

Something like:
- While your script is running, so set 0 the permission to copy, delete, move... a file;
- As your script is not running anymore, set 1 the permission to copy, delete, move... a file

@FrancescoDiMuro this solution would be perfect, how can I change the file permissions using Autoit?

Quote

What about setting their attribute to hidden, or dumping them into a buried directory where the end user wouldn't think to look?

@JLogan3o13 this I already did and other people could find where the file was decrypted, I need to prevent copying and delete the file when my program is no longer using it!

Share this post


Link to post
Share on other sites

The problem with setting the permissions is that (presumably) you're running the script under the end user's credentials - which means if they are as tenacious as you say they are they will have rights to change the ACLs back. You can do a google search on setting ACLs on files - there is even a set ACL UDF on this forum if you search - but you would have to do it under credentials the end user does not have access to.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

@JLogan3o13 I found the ACL UDF and I used the _DenyAllAccess() function to restrict all object access and this worked but I need it to be released just for reading and using _GrantReadAccess() released for reading and for copying as well, how to release only for reading?

Edited by Belini

Share this post


Link to post
Share on other sites
6 hours ago, spudw2k said:

How is that going to help?

I also could not understand how this can help

Share this post


Link to post
Share on other sites

How can I tell when a file is being copied? If I can tell when a copy was started I can shut down the computer and this would solve my problem!

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Can't you just access the decrypted data in RAM without writing to disk? Is it such a lot of data to hold in memory?

Edited by czardas

Share this post


Link to post
Share on other sites

I think it might work but I do not know how to decrypted in RAM without writing to disk, they are video files that I need to protect and release to play without letting them be copied!

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I would have thought _Crypt_DecryptData() would suffice (I haven't used it, so I'm not sure). Unfortunately videos are likely to require too much RAM. I'm also not sure how you would then play the video(s) after that. I'm sure it's doable though. If it were just plain text, it would be easy.

Edited by czardas

Share this post


Link to post
Share on other sites

Perhaps the answer is to decrypt in RAM enough blocks ahead to cope with potential system lag but not the whole beast.

 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I think you just invented streaming video. :) This is a bit over my head. The earlier suggestion (using permissions) sounds a lot simpler. I would still love to see an example of streaming video implemented in AutoIt. Maybe one already exists - I haven't looked.

Edited by czardas

Share this post


Link to post
Share on other sites

In fact the final answer has been posted to the French forum, where the OP is duplicating his request.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

That ?

BTW posting the same request on two fora means twice the job for readers/helpers.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now