I am working on an encryption method between a server and multiple clients. The client hardware only supports basic encryption algorithms (Currently Aes 128-bits and HmacSha1). The hardware is too simple to support TLS/SSL. I have read about Embedded System Communications Security and I also checked https://stackoverflow.com/questions/5235161/aes256-cbc-hmac-sha256-ensuring-confidentiality-and-authentication
Combining this information I came up with an EncryptionClass which takes a weak master key which is unique to each client and also known to the server. The class uses HmacSha1 to generate stronger keys for encryption and authentication. It looks as follows (pseudocode):
EncryptionClass(weakMasterK) {
HmacSha1.init(weakMasterK)
strongEncrK = HmacSha1.doFinal(0) // zero constant in bytes
strongAuthK = HmacSha1.doFinal(1) // one constant in bytes
// Message encryption:
AesCipher.init("ENCRYPT_MODE", strongEncrK)
AesCipher.doFinal(random IV || message)
// Message decryption:
AesCipher.init("DECRYPT_MODE", strongEncrK)
AesCipher.doFinal(encrypted data)
// Hash generation (for authentication):
HmacSha1.init(strongAuthK)
HmacSha1.doFinal(encrypted message)
}
Given the fact that I am not an expert on cryptography at all, I was wondering if anybody sees a problem with this approach, especially with the way keys are generated and used. I would also consider a totally different approach if this requires less computational power than TLS/SSL.