Various applications of cryptography in the real world!

Snigdha Patil
Nov 8 · 8 min read

Where there is exchange/storage of information/data online, there is a need of securing it. Thus, security is of paramount importance.

Digital security is becoming increasingly important to protect our data as we bank, shop and communicate online. And at the core of that security lies encryption. Cyber criminals are constantly trying to attack our data. If we just look at the day-to-day things/apps we use, we may wonder how ‘Cryptography’ maybe used to encrypt and decrypt data.

Application of cryptography in secure message transmission:

SMS is the most widely used mobile service across the globe, where not only people exchange personal messages but also important messages about banking transactions, cash withdrawals from ATM, online items delivery, OTPs, password reset links and important notifications are received. Cyber criminals can thus eavesdrop or intercept these messages to pose threat to individuals. Thus authentication and confidentiality between the communicators must be ensured. Though, it is claimed that all messages use a public key cryptography by the service provider, the messages are readable by the service provider. Hence secured communication over SMS is a big challenge. So how do two peers exchange encrypted and digitally signed messages?

  1. The communication between peers is secured by using public-key cryptography. The key-exchange process is implemented over a voice framework whereby the end users exchange the passkey over the phone.
  2. The passkey is than hashed using AES and the hashed password is used for encrypting the messages. For encryption we use RC4 and AES with Rijndael encryption engine.
  3. At the sender side, a Phone is configured as modem using GSM(Global System for Mobile) technique. The message is composed and encrypted and sent through GSM interface.
  4. At the receiver side, the message is firstly downloaded to PC through PC suite; decryption is than applied over the message.
SECURE SMS MANAGEMENT CENTRE: The SSMC is in charge of handling the provisioning process, used to deliver to new users a customised copy of the SEESMS client application, and the key-distribution process, used to send the public- keys of registered users following a client request. The entire communication with clients is done by using signed SMS messages.

RC4 Algorithm : RC4 is a stream cipher symmetric key algorithm. It was developed in 1987 by Ronald Rivest and kept as a trade secret by RSA Data Security. RC4 uses a variable length key from 1 to 256 bytes to initialise a 256-byte state table. The state table is used for subsequent generation of pseudo-random bytes and then to generate a pseudo random stream which is XOR-ed with the plaintext to give the cipher text. Each element in the state table is swapped at least once. The RC4 key is often limited to 40 bits, because of export restrictions but it is sometimes used as a 128 bit key. It has the capability of using keys between 1 and 2048 bits. RC4 is used in many commercial software packages such as Lotus Notes and Oracle Secure SQL. It is also part of the Cellular Specification. The RC4 algorithm works in two phases:

  • Key setup
  • ciphering
RC4 for encryption and decryption

Few more interesting cryptography applications are as follows:

1. Digital wallet platform Google Pay & Indian E-commerce payment system Paytm:

Paytm uses SHA256 hashing and AES128 encryption algorithm to ensure the safety of transaction data. Paytm uses checksum signature to ensure that API requests and responses shared between your application and Paytm over network have not been tampered with.

Google uses the Elliptic Curve Integrated Encryption Scheme () to secure the payment method token returned in the Google Pay API response. The encryption scheme uses the Encryption algorithm: AES-256-CTR with zero IV and not padded.

2. Algorithm used to encrypt Linux passwords :

is a password encryption function used by Linux to secure passwords. It is based on the DES algorithm with variations intended to discourage use of hardware implementations of the key search. MD-5, SHA-256 and SHA-512 are the implementations used.

3.

Public Key Types

  • Identity Key Pair — A long-term Curve25519 key pair, generated at install time.
  • Signed Pre Key — A medium-term Curve25519 key pair, generated at install time, signed by the Identity Key, and rotated on a periodic timed basis.
  • One-Time Pre Keys — A queue of Curve25519 key pairs for one time use, generated at install time, and replenished as needed.

Session Key Types

  • Root Key — A 32-byte value that is used to create Chain Keys.
  • Chain Key — A 32-byte value that is used to create Message Keys.
  • Message Key — An 80-byte value that is used to encrypt message contents. 32 bytes are used for an AES-256 key, 32 bytes for a HMAC-SHA256 key, and 16 bytes for an IV.

Hence, encryption is used for various Whatsapp features like Exchanging Messages, Transmitting Media and Other Attachments, Statuses and Group chats.

4. Healthcare:

Electronic protected health information(ePHI) needs to be secured and kept confidential so that unauthorised individuals cannot access or use the information, even if they are able to find the information in a database or network. Depending upon the application 3-DES, RSA-1024 bit, AES-256, Blowfish or a hybrid approach is used.

5. Encryption used in various Archive formats:

Sometimes the file is first compressed and then encrypted. Several archive formats like Zip, 7Z & RAR support AES, DES and Blowfish algorithms for encryption. WinZip and PKZIP also use AES-128 bit for encryption of file.

6. Types of Encryption of Databases:

With database encryption, an encryption algorithm transforms data within a database from a readable state into a ciphertext of unreadable characters. With a key generated by the algorithm, a user can decrypt the data and retrieve the usable information as needed. So if a system is breached, the data is still only readable for users who have the right encryption keys.

AES-128, AES-192, AES-256, RSA-1024 bit, RSA-2048 bit, 3DES & Twofish which is also a symmetric block cipher, with keys ranging from 128 bits to 256 bits.


Succinct explanation of some algorithms mentioned above:

Triple-DES Algorithm

In , Triple DES (3DES or TDES), officially the Triple Data Encryption Algorithm (TDEA or Triple DEA), is a , which applies the cipher algorithm three times to each data block. The Data Encryption Standard’s(DES) 56-bit key is no longer considered adequate in the face of modern cryptanalytic techniques and super computing power. However, an adapted version of DES, Triple DES (3DES), uses the same algorithm to produce a more secure encryption. There are two variants of Triple DES known as 3-key Triple DES (3TDES) and 2-key Triple DES (2TDES). A 3TDES key K consists of three different DES keys K1, K2 and K3. The actual 3TDES key has length 3×56 = 168 bits. Second variant of Triple DES (2TDES) is identical to 3TDES except that K3 is replaced by K1. In other words, user encrypt plaintext blocks with key K1, then decrypt with key K2, and finally encrypt with K1 again. Therefore, 2TDES has a key length of 112 bits.

2. -

AES Algorithm

AES is an iterative rather than Feistel cipher. It is based on ‘substitution–permutation network’. It comprises of a series of linked operations, some of which involve replacing inputs by specific outputs (substitutions) and others involve shuffling bits around (permutations). AES performs all its computations on bytes rather than bits. Hence, AES treats the 128 bits of a plaintext block as 16 bytes.

The features of AES are as follows −

  • Symmetric key symmetric block cipher
  • 128-bit data, 128/192/256-bit keys
  • Stronger and faster than Triple-DES
  • Provide full specification and design details
  • Software implementable in C and Java

3. RSA -

RSA Algorithm

is an algorithm used by modern computers to encrypt and decrypt messages. It is an asymmetric cryptographic algorithm. Asymmetric means that there are two different keys. This is also called public key cryptography, because one of the keys can be given to anyone. The other key must be kept private. The algorithm is based on the fact that finding the factors of a large omposite number is difficult: when the integers are prime numbers, the problem is called prime factorisation. It is also a key pair (public and private key) generator.

4. SHA

is a member of the HA-2 cryptographic hash functions designed by the NSA. SHA stands for Secure Hash Algorithm. Cryptographic hash functions are mathematical operations run on digital data; by comparing the computed “hash” (the output from execution of the algorithm) to a known and expected hash value, a person can determine the data’s integrity. A one-way hash can be generated from any piece of data, but the data cannot be generated from the hash.

is a function of cryptographic algorithm HA-2, which is an evolution of famous SHA-1. SHA-512 is very close to HA-256 except that it used 1024 bits “blocks”, and accept as input a 2¹²⁸ bits maximum length string. SHA-512 also has others algorithmic modifications in comparison with SHA-256.

5. Twofish -

Twofish is also a symmetric block cipher, with keys ranging from 128 bits to 256 bits. It’s a fairly flexible method, especially since it’s license-free. The number of encryption rounds is always 16, but you can choose whether you want key setup or encryption to be the quicker process.

6. Blowfish -

Blowfish Algorithm

Blowfish is an encryption technique designed by Bruce Schneier in 1993 as an alternative to DES Encryption technique. It is significantly faster than DES and provides a good encryption rate with no effective cryptanalysis technique found to date. It is one of the first, secure block ciphers not subject to any patents and hence freely available for anyone to use.

  1. block-size: 64-bits
  2. key-size: 32-bits to 448-bits variable size
  3. number of sub-keys: 18 [P-array]
  4. number of rounds: 16
  5. number of substitution boxes: 4 [each having 512 entries of 32-bits each]

Apart from this, cryptography is also used in various businesses, organisations, banking, various social media apps,etc. Hence, cryptography indeed has wide applications in the real world.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade