Decrypting the DEK using KEK under PCI-Standards, which are separated by Servers:
Let say for example we have server1 and server2
Server1:
- It is in East US, called it as Application Server.
- Hosted my website and database.
- In my code I'm using AES 256-bit cryptograpy.
- Store the encrypted cardholder data in DB.
- This server contains Encrypted DEK(Data Encryption Key).
Server2:
- It is in WestUS, called it as Key Server.
- Only contains the Key Encryption Key(KEK) to decrypt the DEK.
- All port are bocked only accept the request from server1.
I have two processes in my mind for implementation. But just got confused which could be a better way:
Process 1:
Below code is running in server1:
public string Data()
{
AES objaes =new AES();
objaes.key= getkey(EncryptedDEK);
//decrypt the values
}
public string getkey(string EncryptedDEK)
{
//connect to the server 2 and get the DEK
request(EncryptedDEK);
}
The below function access the server 2 for decrypting encrypted DEK:
public string request(string encryptedDEK)
{
//check the request
//decrypt the encrypted DEK with KEK
//return the Decrypted DEK
}
On the above process, the application touches the key server.I didn't like my application to touch the key server. I need my key server to be very safe and also to be protective against malicious individuals.
Process 2:
Application requests Card number to server 1 --> Server 1 (Encrypted DEK) --> Server 1 sends Encrypted DEK to the Server2 through SQL SERVER 2012 -->Server 2 decrypts DEK and sends it back to the Server 1 --> server 1 responses to the application with the decrypted data
- Through sql server can I decrypt the Encryped DEK by connecting to the Server 2 from Server 1?
- Which one among the two process works fine or comes under PCI-DSS standards?
- Is there any better way than the above two processes?