When you need to store sensitive data such as CCs or SSNs, do you:
1) Build your own encryption routine within the application, define a secret key somewhere in a config file, and then manually encrypt/decrypt data going to the database.
2) Push all the problem to the database, using the built in DB capabilities (I think most vendors call it Transparent Database Encryption).
What trade-offs have you find for your solution? Does writing your own routine perform poorly when compared to TDE? Is code maintainability, or conversely DB vendor lock-in an issue?