Encryption is a method of converting data into a code to prevent unauthorized access. It uses algorithms to transform readable data into an unreadable format, which can only be decoded with a specific key. Encryption ensures confidentiality, integrity, and security of data.