I have the following process for encrypting and decrypting data in a python script using the PyCrypto module:
Encryption - Server A
- AES 256 shared key is generated
- Associated IV is generated
- Data is encrypted using AES 256 shared key and associated IV using CBC mode and stored into the db
- RSA 4096 public key is used to encrypt the AES 256 key and associated IV which are also stored in the db
Decryption - Server B
- Encrypted AES 256 shared key and associated IV from db are decrypted using RSA 4096 private key
- Data from db is now decrypted using the decrypted AES 256 shared key and associated IV
Does the above process ensure the security of data against an attack model where the attacker has managed to gain access to the database?