csingh926541 (Community Member) asked a question.

CWE 259 Use of Hard-coded Password

I have cryptographic utility but no hardcoded password , everything is coming from configuration. But still Vera code open the flaws.

 

Here some pseudo code

string Encrypt(decryptedText, key, iv)

{

Rfc2898DeriveBytes secretKey = Rfc2898DeriveBytes (key , Encoding.UTF8.GetBytes(iv));

 

CreateEncryptor(secretKey .GetBytes(32), secretKey .GetBytes(16)))

{

// some code

 

return base64;

}

}

 

Nothing is hardcoded here but still Vera Code open the flaw here.

Please help me out.

 


  • csingh926541 (Community Member)

    I have renamed secretKey  to rbg

    Rfc2898DeriveBytes rbg= = Rfc2898DeriveBytes 

    But still it is giving the same issue. Is there something missing ?

    Plesae let me know.

     

    Selected as Best
  • csingh926541 (Community Member)

    I have renamed secretKey  to rbg

    Rfc2898DeriveBytes rbg= = Rfc2898DeriveBytes 

    But still it is giving the same issue. Is there something missing ?

    Plesae let me know.

     

    Selected as Best

Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.