0

Note that this question describe hypothetical case, that is never meant to be used in real world.

Server communicates with clients with message structure: client_id, initialization_vector, encrypted body. Each client each day exchange with server 1-5KB messages average 100 times. Messages "occasionally" may leak out, due to insecure network (e.g. DNS spoofing).

Generated keys are distributed securely to clients by another system. When a key gets compromised, the client can issue another one, but currently the key has no expire time (even after few years). I want to avoid mixing RSA and other asymmetric stuff to keep this simple. Message protocol may change in the future, but previously issued key will be used for stronger encryption without requiring re-issue.

Is this kind of system secure when used with e.g AES/CBC + padding? Can I firmly go forward with this basic approach for years?

Edit 1:

Message initialization_vector is random (AES/CBC) at each message and encrypted_body has internal (encrypted with body) integrity checks (MAC and digest). What makes it insecure despite that? Is option to compromise AES encryption over time really viable in that case?

Edit 2:

Here is pseudo-code of message encryption. When message MAC is not valid, error response is not encrypted (to avoid active attack). System will drop old messages when timestamp is older than T (to avoid reply attack).

init_vector := secure_random (); // for AES/CBC or increment init_vector for AES/CTR
mac = hash (client_id + timestamp + init_vector + text); // MD5 or SHA-1
body = encrypt (mac + text); // AES/CBC
message = client_id + timestamp + init_vector + body;
  • What is a private key in a symmetric key encryption system? It sounds like you are rolling your own encryption scheme. – Aron Jun 19 '15 at 9:03
  • @Aron I changed title to more clear. Generally it is about AES key in long run. – jlmfao Jun 19 '15 at 17:35
  • @jlmfao: As I mentioned in my comment under my answer, a lot depends on exactly how the internal integrity checks work. – user49075 Jun 19 '15 at 18:37
  • @RickyDemer I added integrity check description - hope that's what you mean. – jlmfao Jun 19 '15 at 19:32
  • Well, I can't immediately figure out how to break that (even though your "MAC" is not actually a MAC). – user49075 Jun 19 '15 at 20:04
1

No, although the reason I see is independent of most of your post.
CBC mode is malleable; you should use a MAC too.

  • Even if initialization_vector is random (AES/CBC) at each message and encrypted_body has internal integrity checks (MAC and digest)? What makes it insecure despite that? – jlmfao Jun 19 '15 at 5:31
  • It depends on exactly how the internal integrity checks work. – user49075 Jun 19 '15 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.