Source Code Sections

I am writing a Java class that connects to a server and reads messages in a given queue.

I would like to protect the username and password, which are now displayed as plain text in the source code.

What interests me is this a good way to do this? If I encrypt the username and password in a text file, will I not need to store the key in the text text in any source code that refers to this file? And then anyone who decides to use my class will be able to access these fields.

There is no clue where someone can enter the key, since this class will be autonomously used by the system.

EDIT: this will become a java lib file. But can they be easily decompiled and, thus, basically are the source files of the classes, anyway? And the people this is protected from are developers of other systems that will access this lib file.

My ultimate goal: is to prevent username and password strings from appearing like plain text anywhere and making it as difficult to crack as possible .. p>

+3
source share
5 answers

. / - ( , ), - . , / , , .

, , / , , . , , , .

: , OAuth, . , . , , , Windows, .

+5

, , , . ? .

, , , , , , , , , , , -. , JVM.

, , , . , , SRP, , , , . . , , , .

, . Kork, , , , , .

+1

. , , - . , ( ):

  • .
    • , (, IP-).
  • ( OAuth).
    • , ( )
    • OAuth
    • , + (, ).

, , . , , , , , - , . .

0

, . ? , . , . , , , , - .

0

, , , , , , , . , . , . , , , , , .

, , , , , , .

0

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


All Articles