I have a Python 3 program, and I’m having trouble finding an encryption method that will suit my needs.
Suppose the program is on a thumb drive. I would give the thumb drive to someone else, and they will run it. It will ask them to input a number, and then close.
When it closes, two files are made. An encryption key and an encrypted file that contains their number.
They give the thumb drive to someone else. This person runs the program and inputs a number. The programs decrypts the secret file, checks if the inputted number is < or > the secret number, and displays a message depending on the conditions.
The problem is, the private key is stored alongside the secret file, and I don’t want anyone to be able to read the key file and use it to decrypt the secret file.
Is there an encryption method that will ensure the file is not compromised?