CPP - End While loop for character substitution : This is taken out from Keyshanc Encryption Algorithm. https://github.com/Networc/keyshanc

My question is: How can I possibly manipulate this main method for having multiple encryption outputs with the keys chosen from the password array?

I am not able to break out of the encoding loop right at the end.

int main()
{
   string password[]={"JaneAusten","MarkTwain","CharlesDickens","ArthurConanDoyle"};
    
    for(int i=0;i<4;++i)
    {
        char keys[95];
    
    keyshanc(keys, password[i]); 

        char inputChar, trueChar=NULL;
        cout << "Enter characters to test the encoding; enter # to quit:\n";
        cin>>inputChar;
     
        for (int x=0; x < 95; ++x)
        {
            if (keys[x] == inputChar)
            {
                trueChar = char(x+32);
                break;
            }
        }
        
        while (inputChar != '#')
        {
            cout<<trueChar;
            cin>>inputChar;
            for (int x=0; x < 95; ++x)
            {
                if (keys[x] == inputChar)
                {
                    trueChar = char(x+32);
                    break;
                }
            }
            
        }
    
        return 0;
    }