Cryptography is a method of protecting information and communications through codes and algorithms so that only intended recipients can read it. It aims to provide confidentiality, integrity, non-repudiation and authentication. There are two main types: symmetric-key encryption which uses a shared secret key for encryption and decryption, and public-key encryption which uses separate public and private keys. Common symmetric algorithms include AES, and common asymmetric algorithms include RSA, ECDSA, DSA, and Diffie-Hellman key exchange.