Cryptography can be divided into three types:
Secret key (also called symmetric): uses a unique key both to encrypt and decrypt the information. This way, both the sender and the receiver must have the same key.
Public or private key (also called asymmetric): it uses one key for encryption and another for decryption, one public and one private. The first, anyone can access, while only the owner has access to the second.
Hash functions: they do not use keys but algorithmic systems and mathematical formulas to encrypt the information irreversibly, generating a fingerprint.