Cryptography is the science of using mathematics to encrypt and decrypt data to enable secure storage and transmission of sensitive information. It involves using a key to convert plaintext into ciphertext that can only be read by the intended recipient. There are two main types: symmetric key cryptography which uses the same key for encryption and decryption and is faster, and asymmetric key cryptography which uses two different keys and is more secure but also more complex. Cryptography ensures confidentiality, authentication, integrity, access control and availability of data through techniques like substitution and transposition ciphers.