VBA 密码保护:它是如何工作的?安全吗?有没有其他选择?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/259663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 10:01:28  来源:igfitidea点击:

VBA password protection: how it works? is it secure? are there any alternatives?

excelvbasecurityexcel-vbapassword-protection

提问by axk

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?

如果想要保护 VBA 应用程序以制作试用(演示)版本而不是公开脚本,那么内置的密码保护有多安全?有没有其他选择?

Edit: I'm asking about Excel VBA here.

编辑:我在这里询问 Excel VBA。

回答by Gavin Miller

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.

您的密码安全将在很大程度上取决于所使用的 Office 版本。2007 之前的所有其他 Office 解决方案都可以破解。Office 2007 需要暴力破解密码。默认加密机制是 128 位 AES。

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

这意味着密码的复杂性越高,破解就越难。IE - 数字、特殊字符、混合大小写等。

回答by Ryan Abbott

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

它不是很安全,并且可以很容易地用工具破解。

This videoshows how it's done.

这个视频展示了它是如何完成的。

回答by Onorio Catenacci

If you really want to protect source, thismay 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.

如果您真的想保护源代码,可能是您的最佳选择。对于那些可能不想点击链接的人来说,这是一篇关于为 Excel 2007 开发 XLL 加载项的文章。Xll 是一个专门用于 MS Excel 的 dll。

回答by DaveParillo

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

它不安全。任何人在OpenOffice 中打开您的文档都可以立即访问代码。开放式办公室基本上忽略任何密码保护。

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.

面向对象的人有一个很好的文档来描述Excel 文件格式。第 4.18 节(第 114 页)开始讨论如何处理保护。Onorio 关于使用加载项的建议会减慢某人的速度,但不会阻止坚定的黑客。

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'.

这有点像锁上你家的门。它不会阻止决心进入的人,但确实“让诚实的人保持诚实”。

回答by lbeliarl

Absolutelly argree with DaveParillo, security is quite poor even in 2010/13 version. The only way to protect your file is put password for openning wich uses real crypting (AES 128 bit), option "Encrypt Document" give the same result. All others:

绝对同意 DaveParillo,即使在 2010/13 版本中,安全性也很差。保护文件的唯一方法是使用真正的加密(AES 128 位)打开密码,选项“加密文档”给出相同的结果。所有其他人: