I need to have a secure access from the internet to my squid server.
I have:
auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/passwd
that allow 1 user to use squid from outside but:
1) how to protect squid from bruteforcing?
2) how to encrypt passwords that are send to squid from the internet?
You can protect squid against brute forcing with something like Fail2Ban. It's a fully configurable system that you can use to automatically block any user/ip/etc after attempting a couple of logins on one of your services.
Use a VPN/SSH tunnel to connect to squid. With HTTP everything will not be encrypted by default, so if you want it secure, tunnel it via an encrypted protocol.