Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 13-Nov-18 4:59am

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[^].
 
Share this answer
 
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
 
Share this answer
 
Comments
Dave Kreskowiak 13-Nov-18 11:40am    
No, it doesn't make your password secure. Not is the slightest. Try opening the resulting .EXE in Notepad, dig around a bit and you'll see what I mean.
Aydin Homay 13-Nov-18 14:23pm    
Yes you are right this is why I said use EXE encryption software to encrypt your exe

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900