Protecting an Application's Memory From Tampering

Posted by Changeling on Stack Overflow See other posts from Stack Overflow or by Changeling
Published on 2010-05-25T00:50:21Z Indexed on 2010/05/25 1:11 UTC
Read the original article Hit count: 283

We are adding AES 256 bit encryption to our server and client applications for encrypting the TCP/IP traffic containing sensitive information. We will be rotating the keys daily. Because of that, the keys will be stored in memory with the applications.

Key distribution process:

  1. Each server and client will have a list of initial Key Encryption Key's (KEK) by day

  2. If the client has just started up or the server has just started up, the client will request the daily key from the server using the initial key. The server will respond with the daily key, encrypted with the initial key. The daily key is a randomly generated set of alphanumeric characters. We are using AES 256 bit encryption.

  3. All subsequent communications will be encrypted using that daily key.

  4. Nightly, the client will request the new daily key from the server using the current daily key as the current KEK. After the client gets the new key, the new daily key will replace the old daily key.

Is it possible for another bad application to gain access to this memory illegally or is this protected in Windows? The key will not be written to a file, only stored in a variable in memory.

If an application can access the memory illegally, how can you protect the memory from tampering?

We are using C++ and XP (Vista/7 may be an option in the future so I don't know if that changes the answer).

© Stack Overflow or respective owner

Related posts about c++

Related posts about memory