views:

1646

answers:

4

In case one wants to protect VBA applications to make trial(demo) versions and not to expose the scripts, how secure the built in password protection is? Are there any alternatives?

Edit: I'm asking about Excel VBA here.

+2  A: 

Your password security is going to depend largely upon the version of office used. All other Office solutions prior to 2007 can be cracked. Office 2007 requires brute forcing the password. The default encryption mechanism is 128 bit AES.

This means the higher the complexity of the password, the harder to crack. IE - Numbers, special characters, mixing case, etc.

Gavin Miller
Are there any alternative ways to protect the code in versions prior to 2007?
axk
I wonder how the code is accessed by Excel when it runs it if the code is encrypted?
axk
A: 

It's not very safe, and can be pretty easily cracked with a tool.

This video shows how it's done.

Rorschach
A: 

If you really want to protect source, this may be the way to go for you. For those who may not want to follow the link it's an article regarding developing an XLL add-in for Excel 2007. Xll is a specialized dll for use with MS Excel.

Onorio Catenacci
I don't thinks this is an option in my situation.
axk
I thought it might not be Aleksey--on the other hand, I thought it might be possible that you might know C++ and just be asking about VBA because it's Excel.
Onorio Catenacci
I had some experience with C++ myself, but the problem is that the question is actually from a person who doesn't know C++ and there's already a lot of code in VBA.
axk
A: 

It is not secure. Anyone opening your document in OpenOffice will get immediate access to the code. Open office basically ignores any password protection.

The OO folks have a very good document describing the Excel file format. Section 4.18 (pg. 114) starts the discussion on how protection is handled. Onorio's suggestion on using an add-in will slow someone down, but will not stop a determined hacker.

It's sort of like locking the door to your house. It won't keep out someone determined to get in, but does 'keep honest people honest'.

DaveParillo