Best way to store Encryption Key and IV(Initialization Vector) with AES

Pughazendhi Chandrakasan 1 Reputation point
2024-03-05T10:20:14.8933333+00:00

As a result of the Veracode security scan, the Encryption Key and IV were found to be hard-coded in the code. For encryption, we are also using the old TripleDES algorithm.

In this case, we must remove the hard-coded key and IV and also update to the AES algorithm. This is a utility class that will be used throughout the application (in Web application, Windows application and WCF services)

Hard code key and IV in Encryption class

User's image

It is a legacy application that has recently been moved to AzureDevops. The process of removing hard-coded keys and implementing a new encryption standard presents some challenges.

1.The best way to store the encryption key and IV securely is local/store in files.

2.We don't have option to store in AzureKeyValut and use Environment Variable.

3.Also Client not accepting to store Key & IV store in Web.Config and Database.

  1. Encryption & Decryption mostly used for login and also encrypting some data at runtime.
  2. Mostly use Powershell scripts for automation tasks.

I have chosen AES CBC Mode symmetric algorithm for server side encryption. But Not sure how to deal encryption key storage.

What are the best approaches/secure ways to store the Key & IV locally or any other options available? 

Please assist and share helpful thoughts.

 

Thanks in advance.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,927 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,512 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,866 Reputation points
    2024-03-05T16:30:58.7766667+00:00

    for old asp.net, IIS encryption services is probably best:

    https://learn.microsoft.com/en-us/previous-versions/aspnet/zhhddkxy(v=vs.100)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.