Cryptography means defining the cryptosystem capable of exchanging the information securely. Cryptography secures digital data based on the mathematical algorithm that provide fundamental information security services.

 

Cryptography primitives are nothing but the tools and techniques in Cryptography that can be selectively used to provide a set of desired security services

  • Encryption
  • Hash functions
  • Message Authentication codes (MAC)
  • Digital Signatures

Cryptography secure the messages by encrypting, decrypting the data using public , private keys & digital signatures. There are 3 different ways to implement algorithm mainly as below: -

 

Symmetric Algorithms

It encrypts and decrypts messages using the same key. In case of 3rd party integration both the parties shared the same key to encrypt & decrypt messages to exchange data. It will work only if both are using same key for request & responses. There is a downside to this approach that if by chance the key is stolen and got into wrong hands then adversaries can get read all of your messages.

All other previous algorithm is obsolete today and currently the AES is most widely used in symmetric algorithm.


Asymmetric Algorithms

Asymmetric algorithms are mostly widely used, secured & trusted beco’z it uses a different key to encrypt than they do to decrypt. The encryption is done through public key and the decryption is through private key. If one system is sending encrypted message using public / private and then to read the message the encrypted message the receiver will decrypt the message using private / public key and thus verify the digital signature. These keys will also work in the opposite direction and RSA is most widely used today.

 

Hash Functions

An asymmetric algorithm has a limitation in the size of message that it can encrypt and decrypt and can't be implemented for a large message the way that a symmetric algorithm can. If we want more secured system with the asymmetric algorithm then we need to implement the Hash functions to digest the messages.

Below are some of the popular hash functions: -

MD5

SHA 1

The SHA 2 family (SHA-128, SHA-192, and SHA-256)

The SHA 3 family

MD5 is weaker than SHA1 & SHA2, SHA 1 is somewhat stronger but not like SHA2 algorithm and SHA2 is most widely implemented in cryptography.

Cryptosystems can be created from any of the above-mentioned algorithm to communicate with both confidentiality and authenticity.

I will add more details in the next article for each algorithm with some use case details.