I'm currently working on a project that needs be as secure as possible key-management. My experience with encryption, decryption and key-management are none whatsoever so i did some research on the subject at hand, but im still not sure what i have thought have is safe therefore my questions:
The project in short: A client application that sends(via WIFI) sensitive credit-card data towards a local server which sends the data to a credit-card processor. The communication between the client and the local server needs to be secure at all times and i don't want to rely on settings of the server or router thus i initiate my secure communication.
client application <-> [local server -> PA-DSS Compliance Payment Application] <-> Processor
(I know that for credit-card payments there are requirements given out by the PCI-SSC specifically PA-DSS and i already have read those carefully but i'm not a expert.)
- (Looking at the "Client-Server Setup" below) Is this a correct implementation of a hybrid key-management approach?
- To ensure that the contents of the messages are valid should i add a checksum or hash in the encrypted data?
- The first AES256 key that both client and server have are embedded in code, because this is only needed for first contact would losing this key mean insecurity for the whole system? (i think not but i'm not sure)
- Should i ensure more authentication if yes then how would i achieve this?
As key-management i choose a hybrid key-management system using both AES-256 and RSA-1024/2048.
- [BOTH] client and server have the same AES-256 Key
- [CLIENT] generates a private/public 1024 or 2048 key pair
- [CLIENT] sends the public key (PEM x509 format) encrypted (CBC - PKCS7 padded) under the shared AES256-key towards the server
- [SERVER] decrypts the received data and retrieves the public key
- [SERVER] generates a new random AES-256 key and encrypts with the public key (O-AEP padded)
- [SERVER] returns the AES-256 key encrypted with the public key
- [CLIENT] decrypts the received data and retrieves the new AES-256 key
- [BOTH] further communication is encrypted with the new AES-256 key
Thank you in advance