Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to Fix privacy violation issue in java .

Source is :
C#
public void setPassword(String password) {
		this.password = password;
	}


and it is being use in one method:

finalJsonObj.put("userId", user.getUserId());
finalJsonObj.put("userList", userList);
return finalJsonObj.toString();

Although password in in encryption format .I am not sure how to handle and fix this issue.

What I have tried:

I tried using char[] instead of String for password .
But not able to solve the issue .
Posted
Updated 26-Sep-16 3:56am
Comments
[no name] 26-Sep-16 8:29am    
Ask the technical support people for whomever produced whatever code scanner you are using. They are there to help people use their products.
Richard Deeming 26-Sep-16 9:43am    
What do you mean by "in encryption format"?

If you're storing passwords using a reversible encryption, then you're doing it wrong. You should only ever store a salted hash of the user's password, using a unique salt per record.

Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]
Member 12759596 27-Sep-16 1:15am    
Thank you all for your valuable comments.
We are using DES for password encryption and the tool ehich is throwing the error is :Fortify
Thanks Rechard for links .

1 solution

Having password variable being declared as a string does not necessarily mean it is in readable text. That means it might have string declaration but value being input can be a hash, encrypted string or anything. Best thing to do is check with your code/code of service provider on how this variable is being input.
If you are coder, encrypt/password using irreversible algorithms to ensure even if someone gets that password representation he/she cannot easily decrypt it
 
Share this answer
 
Comments
Richard Deeming 26-Sep-16 10:26am    
Please don't use the term "encrypt" when referring to a one-way hash. It's hard enough to convince people to store passwords properly in the first place, without confusing the terminology. :)

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

  Print Answers RSS


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