REFACTOR and add test cases for encrypting and then generating QR code