Cryptography is the practice and study of techniques for secure communication in the presence of third parties. It involves encrypting plaintext messages into ciphertext that can only be decrypted by authorized parties. There are two main categories of cryptography: symmetric key cryptography which uses the same key for encryption and decryption, and asymmetric key cryptography which uses separate public and private keys. Network security relies heavily on cryptography to protect data transmission over the internet.