Storing passwords for batch jobs

I have a small java program that uses a web service that requires authorization. Thus, java prog (which should be launched using the Windows task scheduler) must have a user / password argument. How can I store them somewhere without creating them in plain text in a file?

So far, I tried to use runtime.getRuntime and CACLS to get the plaintext file, but changed the permissions, so only the owner could open it (did not work, not sure why).

Password encryption does not work, because if I transfer the hash to the web service, the web service is just "errr what? Denied, get lost", but if I use secret key encryption, you need a password to decrypt the password. and where I store it .: P

Help? You are welcome?:)

Thanks.

+3
source share
5 answers

Simple answer:

You cannot make it completely safe, but you can make it more secure.

You CANNOT have a hash password because this will prevent it from being used by your program.

You can put the password in a file and protect the file using OS permissions. You will need to allow the process to access your program for reading. This prevents viewing of any person without administrator rights.

You can encrypt the password and provide a key in your program. This prevents the password from being accidentally monitored by those who can read the file but will not stop (or even significantly slow down) someone who has access to the password and your program.

- .

+2

-, ?

"" dificulty. , - - .

  • ,
  • ( , ), (flash).
+1

, - . , - , , , , , .

, , java- IPC (), . ... ...

+1

:

  • ? Java ( ?)
  • , ? , . .

, Java. , .

0

, Windows, . . , .

Java Wrapper

0

Source: https://habr.com/ru/post/1714040/


All Articles