this attempt has been abandoned, looking at another, more elegant way of accomplishing my goal.
i am trying to use my keygen program to generate a public/private key pair and export that to a file, and then read that key pair into my encrypting program. the problem is at the call to CryptEncrypt (in the encrypt_data.cpp), it gives me an error of NTE_BAD_KEY, and doesn't encrypt anything. anybody know what i'm doing wrong to either get the key into the encrypting program or calling the CryptEncrypt function? or is it even still a problem with exporting the key to file from the keygen program?
please see the attached files