据我所知, vba excel不支持Windows凭据管理器。因此,我想构建自己的凭据经理的迷你版。
我有一个用户输入用户名/密码以登录服务的应用程序。我想以加密的方式保存它,以便下次他们尝试登录凭据时(最多30天)。
加密为直接远期可以访问。
我过去所做的(其他语言)是在服务器上安装带有私钥的证书,然后将证书中的私钥用作加密密钥。在这里,尽管我无法访问应用程序正在运行的1000多个用户机器,因此这并不是一个可行的选择。
我很想使用Windows ,但据我所知,仅是.NET。这里有可行的选择吗?我可以使用用户SID的,但是系统上的所有用户都可以访问,并且不安全。我需要一种方法来生成一个安全的加密密钥,并且仅适用于当前登录的用户。
As far as I can tell, VBA Excel doesn't support Windows Credential Manager. So I would like to build a mini version of my own credential manager.
I have a application that where a user enters username/password to login to a service. I would like to save this in a encrypted manner, so that the next time they attempt to login there credentials are cached(for up to 30 days).
Encryption is straight forward, but the challenge is generating a secure key that only that specific user would have access to.
What I've done in the past(in other language) is install a certificate with a private key on a server, then used the private key from the certificate as a Cryptographic Key. Here though I don't have access to the 1000+ user machines the application is running on so that's not really a viable option.
I'd love to use windows Data Protection, but as far as I can tell that's .NET only. Is there any viable alternative here? I could use the user SID's but that's accessible by all users on the system and is not secure. I need a way to generate a secure Cryptographic Key specific and only available to the currently logged in user.
发布评论
评论(1)
我想将其作为评论发布,但对于评论来说太大了。
VBA于1993年首次使用Excel 5.0 MS推出,然后升级了很多次。 VBA 6.5于2006年左右在Office 2007发行。VBA7.0在2010年左右与Office 2010一起发布,但VBA 7中没有介绍新功能,除了64位支持。
如果我没有错,那么Windows凭据经理是在Windows 7中引入的,我相信我认为该Windows Manager于2009年在某个地方发行。就像我之前提到的VBA 7中没有介绍的新功能。
现在为什么要这段历史课?这是因为VBA比没有明显升级的Windows凭据更古老,因此没有方法,API等与Windows凭据交互。
就VBA创建Windows安全键而言,也不可能。原因很简单。 VBA本身并不安全。您写入加密或解密的任何代码都可以在VBA编辑器中可以看到。如果有人可以访问该代码,则该人可以轻松地使用相同的代码绕过安全检查。即使您使用密码保护VBA,也很容易被黑客入侵。因此,无法从VBA创建Windows安全键。
在这种情况下(使用VBA),解决问题的唯一解决方案是基于硬件的加密。例如,使用USB安全密钥或生物识别技术(指纹扫描仪,虹膜扫描仪等)。 USB安全密钥插入您的计算机的USB端口,并用作额外的安全层。这是银行广泛使用的。
I wanted to post this as a comment, but it is too big for a comment.
VBA was first launched with MS Excel 5.0 in 1993 and then it was upgraded many times. VBA 6.5 was released with Office 2007 somewhere around 2006. VBA 7.0 was released with Office 2010 somewhere around 2010 but there were no new features introduced in VBA 7 except for 64-bit support.
If I am not wrong, the Windows Credential Manager was introduced with Windows 7 which I believe was released somewhere in 2009. And like I mentioned earlier there were no new features introduced in VBA 7.
Now why this history lesson? This is because VBA is older than Windows Credentials with no significant upgrades and hence there are no methods, APIs etc to interact with Windows Credentials.
As far as creating a Windows secure key from VBA is concerned, that is also not possible. And the reason is very simple. The VBA itself is not secure. Any code that you write to encrypt, or decrypt can easily be seen in the VBA Editor. And if anyone has access to that code then, that person can easily use the same code to bypass the security check. Even if you protect the VBA with a password, it can be easily hacked. So, creating a Windows secure key from VBA is not possible.
The only solution to your problem in such a scenario (Using VBA) is hardware-based encryption. For example, using a USB security key or Biometrics (fingerprints scanner, iris scanner etc). A USB security key plugs into your computer's USB port and functions as an extra layer of security. This is extensively used by the banks.