Why does excel's content change when its password is modified? - excel

I tested it by assigning an excel a password. This excel was kept in dropbox, and as I assigned a password to the excel, it was entirely downloaded on every comp that it was shared with. Is there a way that I assign the password and the whole file does not get modified? I am sure that it is not an issue with Dropbox as this is what happened with SugarSync as well.

Without deeper knowledge of the internals I still would say NO - Excel has to store your password for this file SOMEHOW, so I'll guess it will be encrypted and stored within your file, hence binary changing it.
Just so you can check this for yourself:
Make a new Workbook and save it.
Open it, just password protect it, and save it as another Workbook (like the first time)
Now compare those with any HEX or Binary-Comparing tool.

Password protection means that the file is encrypted. There is no point in password protecting a file if it is not encrypted. The only other way to prevent people from viewing a file without encrypting it is to restrict access to it. This can be accomplished by:
1) Modifying the permissions on your computer so that it can only be seen using your password protected account.
2) Not sharing the file with other dropbox users (or share it only with the people you want to see it).
Neither of these is a terribly good security method on it's own. File encryption is always more secure, ideally when used with the above.

Related

VBA: Set permission to read Excel file to whole organization

So, I've run into a VBA problem. Due to IT policies I can't control read/write access to my Excel files on folder level, but have to do it for each individual file. I have a folder with 15 files, that everyone having access to the folder can access and write in. On a certain date I want to lock these files down, so that only a specific group can write, but the rest can still read.
I'm aware it's realtively easy to do this manually (File->Info->Protect Workbook->Restrict Access), but since I already run a macro for other reasons when we want the files locked down, I'd like for it to do this part too. This is where I run into my problem:
I've figured out how to set the permission for a specific user, using this code
Sub set_access()
Dim UserPerm As Office.UserPermission
Workbooks("workbook name").Activate
Set UserPerm = ActiveWorkbook.Permission.Add("name#company", msoPermissionFullControl)
I can loop through this for each person I want to have writing/full access, no problem. There's like fifteen of us and I know who we are.
The thing is I also want everyone in my organization to retain their reading rights. This has it's own button if I do it manually (in the Permission menu that is accessed as mentioned above), but I can't understand how to trigger that setting via vba. I've tried to record a macro of me doing it manually, to see the code, but nothing is recorded. I've also read just about everthing I could find online like four or five times, and what I need simply doesn't seem to be covered.
Does anyone know if this is poosible? Or if it isn't; can I reach the same results some other way?
tldr: I can set permission by individual, but in addition to this I want to give a general read-only access to my Excel files for anyone in my organization. Can this be done with vba? If so; how?
I had the same problem and was looking into it. After all, by using "Everyone" instead of an email address, I was able to set permissions for everyone in my organization. try it.

Lock rptdesign file

I am trying to find out if it is possible to lock an rptdesign file.
The idea is to run a report as a service, but without being able to change the default parameters. I know I could just hide the parameter window but still the user could edit the rptdesign file and hard code new values.
Does anyone has any previous experience with this?
Is it possible to make an rptdesign file non-editable?
If you want to prevent users by modifying rptdesign file, you should do it on OS level to enable it only for certain users.
If you want to ensure that the report is not modified, you can add hidden field storing md5 sum from report file. I mean that this field can store md5sum from your report file on the disk. Then you can compare it with your original sum.
Anyway your problem is slightly different - you are expecting certain data from your customers and you want to be cheated by them. You can use the method with md5sum but it is rather the matter of trust to them here or any other possibility to access to their database than through the report (e.g. they can give you the direct access to the database or you can agree to store this data in your company, not theirs).
Let me know if this answer helps you better.

How can I tell that an excel file is write reserved before opening it?

I have a program that opens excel files, performs functions on them, and then saves them, all without user interaction. I've come across some files that are "write reserved". This is different from password protection, but still require a password to access.
I'd like to tell if these files are write reserved before opening them so I can avoid a prompt, but in order to access the Workbook.WriteReserved property, I must open the file. I'd like to resolve this catch-22 somehow... but I am not sure how to proceed.
The only workaround that I found was to supply a bogus password for the write reservation when opening the workbook. Files that are not write reserved (99% of my use cases) pass unhindered, while the rest that are will throw an exception which I can handle. Not clean, but it works.

Protecting excel-vba application with a key for distribution

I want to distribute excel workbook, protected with an activation key
This is the steps of my idea of protection.
I want to create a key generator to activate the use of the workbook using this data
a pass provided for myself
activation date
username
When the workbook is open, ask for the first key my generator creates, so they need to contact me to get the key to use the product.
When the key is entered, the excel workbook must
a) locks to the location the workbook was saved to work,
b) changes internally the activation key using this criteria.
activation key
a pass emmbeded in code
username
In this way when the workbook is copied to other location, even in the same computer, will ask for a new key, before work, because of the change of location and the change of password. I must prevent be "saved as" to protect it even more. I will developed to work to excel 2007 or higher.
How do you see my idea?
I never worked before doing that things, so, I need suggestions, example code, and all the stuff you want give me, to achieve the goal.
Excel protection is not designed to handle this kind of scenario in a secure way: its only meant to handle casual user errors.
The only secure way of handling this is to convert the Excel application to a compiled DLL: although using obfuscated .NET comes close.

Edit and modify index.dat windows file

In order to be able to speed up user logging times for our product we are trying to implement a preloaded user session scheme. In order to be able to migrate browsing preferences from the preloaded user to the real one we need to be able to edit the contents of the C:\Documents and Settings\User1\Cookies folder: cookie files + index.dat.
In order to achieve this we tried to replace all occurrences of “User1” with say “User2” for cookie files and index.dat. Since both user names have the same character length this change should no break the binary integrity of index.dat file. However after performing this change the cookies no longer work .. Any suggestion would be appreciated.
Editing index.dat seems hopless. The format has never been made public. Trying to reverse engineer it has only resulted in limited sucess: http://www.latenighthacking.com/projects/2003/reIndexDat/
However there are the Microsoft APIs: FindFirstUrlCacheEntry, FindNextUrlCacheEntry, InternetGetCookie, InternetSetCookie that can be used to export and import cookie data.

Resources