0

I'm encrypting some data that needs to stay on the client, and so will the Salt, Key and IV. Is there a standard way of handling this data on the client to prevent people from discovering it and encryption your data?

I can think of plenty of things to obscure them, but there must be an industry standard way of dealing with this issue.

Kelly
  • 6,992
  • 12
  • 59
  • 76
  • http://blogs.msdn.com/b/ericlippert/archive/2011/09/27/keep-it-secret-keep-it-safe.aspx – SLaks Nov 28 '12 at 23:04
  • That describes how keys work over http. My situation is different. I have a client and no server at all. And I need to encrypt something on the client. I don't know where I should store the Key, IV and Salt. – Kelly Nov 28 '12 at 23:15
  • @Kelly: If you're storing the key on the same device as the data, you aren't adding any security. – SLaks Nov 29 '12 at 01:09

1 Answers1

1

There's no additional security risk if the IV and salt are known. IV's are safe to store in the clear, and salts are to help prevent precomputation and rainbow tables.

So you're really just talking about the key. There's a couple solutions, each with it's own tradeoffs. In your question, you only mention you need to encrypt data on the client. Does the client not need to decrypt?

  • If this is a Windows client, you can use the Data Protection API to protect the key under the users credentials.

  • Protect the key with a passphrase. If you don't mind entering a passphrase each time the client needs the key, this can offer reasonable protection, and it's supported in most cryptosystems like OpenPGP.

  • If the client only needs to encrypt, you can use a hybrid approach with public keys (like OpenPGP). In this case, you only store the public key on the client, and the private key somewhere safe. When you encrypt data, you'll generate a random symmetric key, and encrypt that under the client's public key. Now if someone compromises the machine, they won't be able to decrypt any of the session keys.

  • Use specialized hardware like a hardware security module or smart card. This is the most expensive route, but depending on your threat model might be viable.

Community
  • 1
  • 1
mfanto
  • 14,168
  • 6
  • 51
  • 61
  • I do need to decrypt on the client, but I believe your answer has what I need. Thank you. – Kelly Nov 29 '12 at 01:00