I am new to cyber security but I am working on a project where I need to use it and I don't know where to start.

The application I am working on connects to Jira to retrieve data and generate reports. For the connection, I want to use a specific username and password. I cannot set them as a string in my code because every user would get my credentials. So, I thought about writing an encrypted file.

The thing is if want to decrypt my file I will need to provide the decryption key in my code. and I think this is not secure at all because anyone that had access to the key could easily decrypt the file and therefore get my credentials.

I found a method that encrypts a file and makes it so that the only person that would decrypt is the user who encrypted it. The problem is that the admin is the only one who has the right to encrypt the files and this will only mean that he would be the only one for whom the connection to Jira would work as he is the only one able to decrypt the credentials.

I am also worried that if I read and decrypt the credentials then anyone could use a console.writeline and get the credentials.

I am using c# for my application.

Are there any ways I can secure my credentials?

To connect and retrieve data from JIRA I need the username and password because I add them to my request header to connect and retrieve data.

  • 1
    I would suggest looking at this thread: stackoverflow.com/questions/32548714/…
    – Sean
    Aug 27, 2018 at 12:32
  • 1
    Or this question: security.stackexchange.com/questions/20294/… - The accepted answer has a valid solution of storing credentials in a file that is only readable by the program in question. Aug 27, 2018 at 12:35
  • Your comment below includes some very important details: this is an open source app to be used by multiple users. Why do you want to use your personal hard-coded credentials for all those connections?
    – schroeder
    Aug 27, 2018 at 14:12

2 Answers 2


There is a bit of a Chicken and Egg Problem.

The only thing that can be used is User Permission on the Device. That means that there is a File that only the User from the Application can Read (OS-Permissions) or a Services where only the Logged In User has access to (example: Windows Credential Management API).

Any other option is just more Obfuscation than "Encryption". How will you encrypt something, where you get a secret, without enter the another secret but other users should not get your secret. All options just go to a deeper Obfuscation (first Hardcoded, secound a scrambeld String, then a scrambeld String with another Random String linked,...)


please hash your password using MD5 or SHA and add a salt key to your hashed password. In password checking field again get the data from text box of password and hash using the same algorithm which used before and add salt key value then compare both values.

  • the thing is i don't want anybody to enter username and password because nobody should know the username and password. i am going through all this cyber security process because i want the app to know them hide them from the users and use them. the app is also not pre-compiled and wouldn't be installed. it's code. the engineers who use it have to modify some parts of the code according to the project they want to use the app for. (this part is not my choice i'm just adding functionality to an existing app for my client who doesn't want to change the app)
    – naxcuo
    Aug 27, 2018 at 13:35
  • 1
    OP problem is not password check, is password storage. Your answer is for another kind of problem.
    – ThoriumBR
    Aug 27, 2018 at 14:12

Not the answer you're looking for? Browse other questions tagged .