在Windows批处理文件中加密/屏蔽密码 [英] Encrypt/mask the password in windows batch file

查看:530
本文介绍了在Windows批处理文件中加密/屏蔽密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在使用java登录程序进行EPM自动化。



我直接使用我的用户名,密码,windows bat文件中的主机详细信息。因为我需要安排批处理。所以我想在java或bat文件中隐藏或加密密码。



你能告诉我如何加密或掩盖java和bat文件中的密码。



我尝试过:



当我使用命令提示输入i时它会显示星号。



但我需要在批处理文件中加密密码。

Currently I am working on EPM automation using java login programs.

I am directly used my user name,password,host details in windows bat file. because i need to schedule the batch.So i want to hide or encrypt the password in java or bat file.

Could you please tell me how to encrypt or mask the password in java and bat file.

What I have tried:

When i was given input using command prompt it displays asterisk.

But i need password encryption inside the batch file.

推荐答案

您不应将密码存储在代码或批处理文件中,也不应对密码使用加密。请参阅简单解释安全密码验证 [ ^ ]。
You should not store passwords in the code or in a batch file, and you should not use encryption on passwords. See Secure Password Authentication Explained Simply[^].




据我所知,没有解决方案可以让你在批处理文件中保护你的密码。但是,总有至少一个技巧。例如,在这种情况下,您可以使用某些软件将批处理文件转换为exe,这将使您的源代码安全无虞。我相信如果你谷歌你会发现很多不同的选择。

另一种方式更复杂但可能,用户shell而不是批处理文件和Windows身份验证中继。



要获得一些提示,请参阅以下链接:

在批处理文件中安全使用密码? - Microsoft Windows - Neowin [ ^ ]



干杯,

AH
Hi,
As far as I know there is no solution that allows you to secure your password in batch file. However, there is always at least one trick. For example in this case you can use some software to convert your batch file to exe this will make your source code secure out of box. I am sure if you google you will find a lot of different options.
The other way is more complicated but possible, user shell instead of batch file and relay on windows authentication.

To get some hints see the below link as well:
Secure use of passwords in batch files? - Microsoft Windows - Neowin[^]

Cheers,
AH


这篇关于在Windows批处理文件中加密/屏蔽密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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