DO NOT STORE FULL CREDIT CARD INFO ON YOUR OWN SERVER.
Even if encrypted, storing full credit card data on your own server is generally a very bad idea due to the security and legal ramifications should your website/database/server ever be compromised.
Many places store the last four digits of the credit card on their server for quick access or ease of identification, but only the last four digits. The full card can be associated with the account or payment selection with a payment gateway. Whichever gateway you are using may already have built-in functionality for this, like for example PayPal:
https://developer.paypal.com/docs/integration/direct/store-a-credit-card/
This way you do not have to store the actual card number on your server, but then you are still able to allow your site members to store different credit card aliases and last four digits so they can select the one they want to use. The payment gateway then assumes the risk, PCI compliance, and the complications involved in securing their servers and the stored credit card numbers so you don't have to.
If you do still want to pursue this, then this question is actually better posed at stackoverflow as secure database encryption and PCI compliance and sensitive data storage are not really EE-specific.