是否有一种加密存储在VBS中的密码的方法 [英] Is there a method to encrypt passwords stored in a VBS

查看:313
本文介绍了是否有一种加密存储在VBS中的密码的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VBS脚本,我在工作中用于在连接到Cisco路由器和交换机时自动执行任务,包括自动执行登录过程。没有不合理的人对于将他们的密码存储在纯文本VBS文件中有点前卫,所以我为他们提供了每次提示密码或将其存储在脚本中的选项。



有没有一种方法可以调用一个可以处理加密的Windows API?我需要一种方法:a)加密原始密码,以便将其安全地存储在脚本中,以及b)提供一种调用解密功能以在主脚本中使用的方式,以便我可以使用纯密码。在VBS中没有内置的加密/解密功能,我可以找到。



我意识到,任何有权访问脚本来读取密码的人也可以轻松添加WScript.Echo Decrypt(strEncryptedPassword)类型的行到脚本,但这似乎不担心任何人!



任何帮助将不胜感激。我对API编程不是很好(实际上我是一个可怜的VB6程序员转向网络工程师),所以请记住回应。

解决方案

检查这篇文章



还要考虑以下链接:



加密功能



解密函数



如果您对更强大的加密感兴趣,请检查这篇文章


I have a VBS script I use at work for automating tasks when connected to Cisco routers and switches, including automating the login process. Not unreasonably people are a little edgy about storing their password in a plain text VBS file, so I provide them with the option to prompt every time for the password or have it stored in the script.

Is there a method by which I could call out to a Windows API which might be able to handle encryption for me? I would need a way to both a) encrypt the original password so it could be safely stored in the script, and b) provide a way of calling the decrypt function for use within my main script so that I can use the plain password. There is no built in function for encryption/decryption in VBS that I can find.

I realise that anyone with access to the script to read the password could also easily add a "WScript.Echo Decrypt(strEncryptedPassword)" type line to the script, but this doesn't seem to worry anyone!

Any help would be appreciated. I'm not great with API programming (in truth I'm a poor VB6 programmer turned network engineer) so please bear this in mind with responses.

解决方案

Check this article

Also consider the following links:

Encrypt function

Decrypt function

If your are interested in stronger encryption, then check this article

这篇关于是否有一种加密存储在VBS中的密码的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆