1

This question already has an answer here:

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.

marked as duplicate by Steffen Ullrich, ThoriumBR, tlng05, Josef, forest Aug 31 '18 at 23:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

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,...)

0

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 '18 at 13:35
  • 1
    OP problem is not password check, is password storage. Your answer is for another kind of problem. – ThoriumBR Aug 27 '18 at 14:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.