c++ hide credentials

#include <iostream>
#include <string>

class CredentialManager {
private:
    std::string username;
    std::string password;

public:
    CredentialManager(const std::string& u, const std::string& p) : username(u), password(p) {}

    void displayCredentials() {
        std::cout << "Username: " << username << "\n";
        std::cout << "Password: " << password << "\n";
    }
};

int main() {
    std::string inputUsername;
    std::string inputPassword;

    // Get credentials from user input or any secure source
    std::cout << "Enter your username: ";
    std::cin >> inputUsername;

    std::cout << "Enter your password: ";
    std::cin >> inputPassword;

    // Create CredentialManager object with user input
    CredentialManager credentials(inputUsername, inputPassword);

    // Access and display credentials through a controlled interface
    credentials.displayCredentials();

    return 0;
}