0
votes

I'm building a worksheet on microsoft excel and it will deal with sensible business data. The worksheet will be placed on a USB drive and have to move from place to place constantly. Therefore I've created a feature in excel VBA to enable/disable password protection. Here is how it works.

A page named settings is xlVeryHidden containing the user's password in a cell, another cell in the page contains the word yes or no. Depending on weather password protection is activated or not. When the user first opens the Workbook all sheets are xlVeryHidden except one containing a button to continue, they click on the button which runs a macro to check weather in the settings sheet the word is yes or no. Depending on so, they are prompted with a login or all the sheets are unhidden.

The code for the login is the following:

If PasswordTextbox.Text = ThisWorkbook.Sheets("Settings").Range("J5").Value Then

And after that all sheets are unhidden. Else it will give an error Msg Box.

Also the VBA code editor will be protected with excels default system.

What I'm asking here: Is my system fairly secure? For a regular computer user would this be hard to crack?

Thanks in advance :)

1
Not really secure at all - maybe enough to prevent casual peeking, but will not prevent someone who really wants to look.Tim Williams
it can take less than a minute to unprotect it. With brute force macro maybe less than hour depending on how long is the password.Slai
You could store the passwords hashed using md5 or similar custom functions so it's not plain in the file. You could also 7zip the file with a password for an extra layer but mentioned above its not sercure, it's inconvenient to hack, If u went as far an encrypting the data in the cells using a password that's not stored in the file , this would be secureSteven Martin
I agree with @Slai regarding brute force. I have built a macro myself to attack other protected worksheets and it usually is done in under 5 minutes.Jason
Why not using Protect Workbook>Encrypt with Password? That will encrypt the whole file. So the password is needed to decrypt to read the file content. This will be most secure.Axel Richter

1 Answers

0
votes

I'll add that it is pretty easy to unprotect your macro to get access to your code. If possible, you should think about implementing a protected database to store your sensitive data and populate your excel file from there, after proper authentication from the user.