I have made a program which has sensitve data hardcoded into it. Let's imagine that sensitve data is the password for my safe at home.
I realized that it is pretty unsecure to have the data hardcoded in the source code of the application. If somebody was able to break into my system, he/she could use a hex editor/debugger to find that string. So I came up with the idea to create a file on the harddrive containing the password, encrypt it with a strong algorithm, and then let the program ask for the key on startup. If the correct key is entered, the application will be able to parse the content. If a wrong key is entered, the application will parse garbage and crash, but the attacker can't get the password. To make sure nobody else can get hold of that key, I would print it out on a piece of paper and store it at home. My main problem is:
I want to use a secure algorithm for encryption and at the same time have a relatively small key. The algoithms I had a look at so far (RSA, AES) use long keys which I do not want to type in everytime I start the application. Is there an algorithm which fits my needs, or maybe another "plan" which is as secure as the idea I had?
PS: I know that when the application has loaded the password into memory after a successful boot, an attacker could get hold of it there. But that's another topic for another day.