• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro code - Strong Protection

Dhamo

New Member
Hi,


How to prevent the user to see the code apart from this option.

VBA Project Properties - Protection - Lock for viewing.


I know it is very strong, but still there are chances to break this code.


Thanks,
 
i'm afraid there's no "ultimate" security out there for XL. The best you can do is try to make things difficult enough that someone doesn't want to spend the time/effort to break the security. There's various "tricks" you can do beyond adding the VB password, such as saving the code in a shared workbook and then turning it into an add-in (shared workbooks can't access code, so this will foil a basic VB password hack). Of course, someone who realizes this could change it back from an add-in and unshare. Another option is to do a VB scramble, which tries to make your code unreadable/un-followable.

http://www.excelhelpdesk.com/protection/protect-vba/


I haven't used any VB scramble products, so I can't endorse/guide on any of them. My rule of thumb though is, if someone has access to your file, assume that they can read anything in it.
 
Thanks Luke,


There are few crackers available to break the vba (password protected) code. I am expecting is there any options to encrypt the whole code as even crackers cant bypass?
 
Good day Dhamo


If some one is detemined enough they will get in to all of a spread sheet/workbook, no stopping them
 
I'm afraid bobhc is correct. While you could extract the code to a text/word file and encrypt it via 256 bit encryption and send that via email to someone (say you need to send proprietary code but don't want it intercepted), it is currently believed that 256 bit is strong enough to prevent anyone from brute force cracking it within 100 years, the code is not functional while it is encrypted. This method would only be useful for transferring the code to someone else who would then decrypt it and install.
 
Hi, Dhamo!

Maybe you want to give a look at this link and it dependent sublinks:

http://chandoo.org/forums/topic/macro-to-hideunhide-in-protected-sheet-produces-error-code#post-37901

And if looking for deliberately obfuscated coding examples, I think this should be one of the smartest and nicest ones:

http://chandoo.org/forums/topic/how-to-write-a-macro-to-print-data-pertaining-to-a-list-box#post-23051

Regards!
 
Dhamo,


The simple - but ineffective - solution:

Lock your VBA project using a password. Your VBA code will still run, but can only be viewed by a user who knows the correct password. Unfortunately, there are plenty of fairly inexpensive software tools that could recover a lost or forgotten VBE password, no matter its length or complexity, within seconds.


In addition, Excel VBA code can be read directly (without using Excel) by many spreadsheet applications. For example, please note that 'LibreOffice Calc' doesn't seem to honor any VBE password protection in Excel files.


The advanced solution: S1-CrunchCode

There is a solution called VBA obfuscation. Obfuscation is a set of techniques that hide the intent of your Excel VBA program without changing its runtime behavior e.g. obfuscated VBA code will run in both 32/64 bit Office 2010/2013 versions, if your original code was designed to do so.


When obfuscation is properly applied, it can increase the protection against hackers by orders of magnitude, while leaving your Excel application intact. Obfuscation is commonly used in .Net and Java environments for years and has been helping companies protect their intellectual property.


For more info:

http://www.spreadsheet1.com/s1-crunchcode.html
 
@spreadsheet1

Hi!

This is the same information you posted many times 6 months ago, it's beginning to sound like spam or undercover publicity. Please stop doing so or your posts will be edited or deleted. We, the community, yet know the amazing feature of the product you're advertising.

Regards!

PS: BTW, you're writing on a 3 months old post. I don't think the OP would come back soon -if ever- to read your article.
 
Back
Top