Encryption works by using keys to scramble and unscramble data during transmission. Symmetric key encryption uses a single secret key shared between computers, while public key encryption uses two keys - a private key known only to the sending computer and a public key given to computers wanting secure communication. Common encryption protocols like SSL and TLS allow sensitive information to be securely transmitted on the internet by authenticating users and encrypting data between web browsers and servers.