Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Verifying CVV number


Recommended Posts



I'd like to verify the CVV number customers enter. Someone told me that you verify it by using some algorithm against the main card number, is this true? If not, what are the conditions it must meet for given cards?


Hope someone knows.



Link to comment
Share on other sites

Although an algorithm is used to generate/validate the CVV, you would not be able to "figure it out" it since you are missing certain constants:


To calculate a 3-digit CVV, the CVV algorithm requires a Primary Account Number (PAN), a 4-digit Expiration Date, a 3-digit Service Code, and a pair of DES keys (CVKs).


The only way to validate it is through your merchant account.




Link to comment
Share on other sites

In other words, this validation is something that needs to be down by an actual payment gateway during a real-time transaction, yes?


Thanks Rob!



If you think about it...

If you could calculate it then so can the crooks.



Link to comment
Share on other sites

It makes perfect sense to me, my client was insistent the previous developer had removed the functionality though. Thank god I'm not barmy.


Thanks again Rob, much appreciated!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...