I'm not sure I understand what you want to do. Do you actually want to verify the validity of the transaction or secure items against theft? What are barcodes used for? Are they assigned to specific products? Are they unique?
Can you describe the specific usecase better?