Reputation: 15492
First off: I'm working on an e-commerce site that will accept credit cards. In order to get from the "Enter your information" page to the "Confirm your information" page, I need to store the credit card information somewhere that it can be retrieved before it ultimately gets sent to the payment gateway.
I'm currently leaning towards storing it as a session variable. That being said, my question is:
Upvotes: 2
Views: 3432
Reputation: 5390
Requesting the credit card is the last step in the sales process. But if you want to encrypt it, use symmetric AES (rinjdael) encryption. In order to use a very difficult to guess key create it randomly and store it at session too. If you are using cookie-less session none of the two will get out of the server until you want it.
There are version of AES libraries for almost any language. In .NET there are included into the System.Security.Cryptography
using System.Security.Cryptography;
Upvotes: -1
Reputation: 22578
From a ui/workflow standpoint, there really isn't any need to store the credit card information or confirm it. If it is wrong, it won't be approved. Most e-commerce sites request the credit card number as the last step after confirming address, phone etc.
As for session, session is global to the particular session. It is not shared by other users and in general, there isn't any way to get at the data in other sessions. As such, no need to encrypt it since it is stored on the server.
If you stored sensitive information in ViewState or passed it over the QueryString, you would definately need to encrypt it.
Upvotes: 3