How Cryptography Works To Secure Our Data.
Understanding Encryption, Decryption, and Hashing…
Introduction.
Cryptography is the practice of securing communications by transforming plaintext into ciphertext, to prevent unauthorized access. The process of transforming plaintext into ciphertext is called encryption, and the reverse process of converting ciphertext back into plaintext is called decryption. Cryptography can be used to protect a wide variety of information, including financial transactions, email messages, and computer files. cryptography are use many different encryption algorithms that have been developed for different purposes, and modern cryptographic systems often use a combination of different techniques to achieve a high level of security.
The objective of Cryptography.
- Confidentiality:- Cryptography can be used to protect the confidentiality of sensitive information by encrypting it so that it can only be read by authorized individuals.
- Integrity:- Cryptography can be used to ensure the integrity of a message or other data by detecting any changes or tampering that may occur during transmission.
- Access control:- Cryptography can be used to control access to a resource or system by providing a secure means of authentication.
- Secure key exchange:- Cryptography can be used to securely exchange keys between parties, allowing them to communicate securely.
- Digital Signatures:- Cryptography can be used to prove the authenticity of the signed document and the signer's identity.
- Data protection:- Cryptography can be used to protect data stored on a computer or in transit over a network, ensuring that it is only accessible to authorized individuals.
- Authentication:- Verifying the identity of individuals or systems seeking access to information.
- Non-repudiation:- Cryptography can be used to prevent a sender or receiver from denying that they sent or received a message or other data.
Basic Communication Model.
- Key agreement:- This is the first stage of the cryptography communication model, where the sender and the receiver agree on a specific encryption algorithm and key exchange method.
- Encryption:- The sender creates the message and then encrypts it using the agreed encryption algorithm and the recipient’s public key (in case of asymmetric encryption) or a shared secret key (in case of symmetric encryption).
- Transmission:- The sender sends the encrypted message through the channel.
- Decryption:- The receiver receives the encrypted message and decrypts it using the appropriate key (i.e private key in case of asymmetric encryption or the shared secret key in case of symmetric encryption)
- Message verification:- The receiver verifies the authenticity of the message by checking the integrity of the message, either by using a digital signature or a message authentication code (MAC).
- Interpretation:- The receiver then interprets the decrypted message to understand its meaning.
Types of Cryptography.
- Symmetric-key Cryptography: Symmetric-key Cryptography uses the same key for encryption and decryption.
- Asymmetric-key Cryptography:- Asymmetric-key Cryptography uses a pair of keys, one for encryption and one for decryption.
- Hash functions:- Hash functions are used for data integrity and digital signature.
Symmetric key Cryptography.
Symmetric key cryptography, also known as secret key cryptography, is a method of encrypting and decrypting information using the same secret key. This key is used to both encrypt and decrypt the data, and it must be kept secret from anyone who should not have access to the original information. The sender and the receiver must both have a copy of the secret key and use it to encrypt and decrypt the message. This method is relatively fast and efficient but the major drawback is that the secret key must be securely distributed and kept secret.
Get Ritesh Sahu’s stories in your inbox
Join Medium for free to get updates from this writer.
Examples of symmetric key algorithms include:-
Asymmetric key Cryptography.
Asymmetric key cryptography, also known as public key cryptography, is a method of encrypting and decrypting data using a pair of keys: a public key and a private key. The two keys are mathematically related, but it is computationally infeasible to deduce one key from the other.
A sender can use the recipient’s public key to encrypt a message, and the recipient can then use their private key to decrypt it. This ensures that only the intended recipient can read the message, as the encryption is performed using the recipient’s public key, which is available to anyone.
Examples of Asymmetric key Cryptography algorithms include:-
- RSA (Rivest-Shamir-Adleman)
- DSA (Digital Signature Algorithm)
- ECC (Elliptic Curve Cryptography)
Hash functions.
Hash functions are an important tool in cryptography, used to ensure the security and integrity of digital communications. They are mathematical functions that take an input, or ‘message’, and produce a fixed-size string of characters, known as a ‘digest’ or ‘hash value’. The digest is unique to the input, and even a small change in the input results in a completely different digest. This makes hash functions particularly useful in cryptography as they can be used for various purposes such as message integrity, password storage, digital signatures, key derivation and data indexing.
Examples of Hash functions algorithms include:-
- MD5
- SHA-1
- SHA-2
- SHA-3








