We use firewall to prevent hacking (unauthorized access is the use of a computer or network without permission).
Cryptography is a process of transforming plaintext into ciphertext then back again.
Encryption is a process of converting plaintext into ciphertext. Decryption is the process of converting ciphertext into plaintext.
An encryption key is a formula that the sender of that data uses to encrypt plaintext. A decryption key is a formula that the recipient of that data uses to decrypt ciphertext.
Until recently, encryption was used only by intelligence service, militaries, and banks. We use cryptography to secure the information and prevent hacking or unauthorized access.