I have messages of three pieces:
- User name
- IV, 16 bytes
- 128-bit AES Encrypted payload
Users could be running from several processes/devices on the same network and are exchanging messages via a message bus. Each user has a pre-shared key (they get it via a call to a central server via SSL) which is renewed every X hours and is stored in memory.
If I successfully decrypt the third part of a message with the pre-shared key (e.g. with try..catch(CryptoException)...
), am I safe here to assume that it came from the user indicated in the part 1 of the message?
If the network is open (WiFi without encryption), are there any risks of exposing data other than the metadata of user name (which is OK)?
This must be trivial and I now assume it will work, but an assumption is the mother of all mistakes, especially in crypto...
Also (mostly out of curiosity), if several users are in the same process and a rogue user A knows the source code of the app (C# reflected from dll) and could sniff all traffic on the machine, what additional steps I need to protect the shared keys of other users in the same process from the user A? (the app in C#, the rogue user could run anything in addition to the app, e.g. assembler). Should I bother at all, or the game is over if a rogue user has such access?
Update: Week 4 of this wonderful course is the must for such kind of questions: https://class.coursera.org/crypto-010/lecture/preview
What I intuitively expected is called Synthetic IV https://www.rfc-editor.org/rfc/rfc5297 and is very well descrived in one of the lectures in the linked course