I am looking at setting up a pre-pay system for the food retail industry. Retailers will be able to generate random 10 digit codes and supply these to customers to enter into an app to gain the value assigned to the code. My database is similar to the following
+----+-----------+-------------+-----------+-------+
| ID | code | activated | user | value |
+----+-----------+-------------+-----------+-------+
| 1 | iijwd923j | 0 | | 10 |
+----+-----------+-------------+-----------+-------+
| 2 | aidwd923j | 0 | | 10 |
+----+-----------+-------------+-----------+-------+
| 3 | jksjwdijk | 0 | | 10 |
+----+-----------+-------------+-----------+-------+
| 4 | jiejdedow | 0 | | 10 |
+----+-----------+-------------+-----------+-------+
| 5 | iwqjdwdqd | 0 | | 10 |
+----+-----------+-------------+-----------+-------+
Lots of columns omitted as they aren't required here. When the retailer generates the code it is hashed and salted before going into the database. When the code is entered into the app their id is assigned to the code and it is activated. The retailer can also activate or deactivate the code should codes go 'missing'. This is done by the index.
Do you foresee any security issues here?
codecolumn, the values are indeed hashed, not in clear text (as shown)? – Henning Klevjer Oct 26 '12 at 6:55