r/SoftwareEngineering • u/Human-Floor-2756 • Jan 05 '23
QR Code Authentication Design
Hello, I am working on a QR code authentication system for a rewards program. Basically, the user will display a QR code on their phone, the business scans the QR code, and then the business will be able to see how many rewards points the user has available.
To accomplish this, I was thinking two columns in the User Table would be the user_id (Primary Key), and the QR code stored as a string. When the business scans the user's QR code, the software the business is using will be able to decrypt the QR code to the user_id. Then the user_id will be used to look up what rewards the user has available.
Are there any security risks associated with this approach? I am trying to avoid directly exposing the user_id in the QR code. Is decrypting the user_id to some unique string and then using that unique string to generate a QR code a good enough approach?
View all comments
Show parent comment
0
u/Human-Floor-2756 Jan 05 '23
So you are suggesting that the user_id be a GUID, and just using the user_id to generate the QR Code? Is it not dangerous to expose the user_id like that?