Cryptography is the science of using mathematics to encrypt and decrypt data. There are two main types: symmetric key cryptography which uses the same key for encryption and decryption, and asymmetric key cryptography which uses a public/private key pair. Symmetric algorithms include the Caesar cipher and Vigenere cipher which shift or substitute letters, while the RSA algorithm is an example of an asymmetric algorithm that uses a public/private key pair to encrypt and decrypt messages. Cryptography allows for secure storage and transmission of sensitive data over insecure networks.