def get_password(ssid: str) -> str:
    """
    Gets the password for a given SSID
    """
    password = ""

    if ssid == "" or ssid is None:
        print("SSID is not defined")
        return password

    platform = get_platform()

    try:
        if platform == constants.MAC:
            password = run_command(f"security find-generic-password -l \"{ssid}\" -D 'AirPort network password' -w")
        elif platform == constants.LINUX:
            # Check if the user is running with super user privilages
            if os.getuid() != 0:
                password = run_command(f"sudo nmcli -s -g 802-11-wireless-security.psk connection show '{ssid}'")
            else:
                password = run_command(f"nmcli -s -g 802-11-wireless-security.psk connection show '{ssid}'")
        elif platform == constants.WINDOWS:
            password = run_command(f"chcp 437 | netsh wlan show profile name=\"{ssid}\" key=clear | findstr Key")

            if password != "":
                password = re.findall(r"Key Content\s+:\s(.*)", password)

                if len(password) > 0:
                    password = password[0]
                else:
                    password = ""
    except Exception as ex:
        print(f'Error: {ex}')

    return password

    Gets the password for a given SSID
    
wifi_password/utils.py