I've just been looking into RSA encryption with C++ and am wanting to make a program that can en/decrypt files of my own custom file extension. Obviously I need to choose two primes numbers (for my p and q values) to encrypt and decrypt this file, but I am curious as to how I could stop these values being pulled out of my program via de-compiling.
Obviously, with the primes in hand, someone could easily calculate the necessary values for the private key that ONLY this executable should have.
Are there methods for somehow generating a random private key that will always unlock the public key?