Home / Wiki / D / Digital Encryption and Decryption

Digital Encryption and Decryption

Fraud Scams and Financial CrimeUpdated 13 Nov 2026

Digital encryption and decryption are the two halves of the process that keeps electronic messages private. Encryption uses a mathematical recipe, called a cipher, and a secret value, called a key, to turn a readable message into scrambled ciphertext; decryption applies the matching key to recover the original. Every card payment typed into a website, every login to a banking app and every message in an end-to-end encrypted chat depends on it.

This entry explains the mechanics: how a message is scrambled and unscrambled, how the two families of ciphers differ, and how they combine in payments and messaging. How organisations protect the data they store and send, including key management and compliance rules, is covered in data encryption and decryption. Both belong to the wider field of cryptography.

01

Encryption and decryption in plain terms

Imagine sending a note across a crowded classroom. If you write it in a code that only you and your friend understand, anyone who grabs it on the way sees nonsense. Encryption is writing the note in code; decryption is your friend reading it back. The code book is the key, and the whole system is only as safe as that code book.

The hard part has always been sharing the code book. If you have to hand it over in person, you cannot talk safely to a stranger, such as an online shop you have never visited. Modern encryption solved this with a clever trick: a padlock that anyone can snap shut, but only one person holds the key to open.

02

A short history

Ciphers are ancient, but digital encryption dates from the computer age. The US government adopted the Data Encryption Standard (DES) in 1977 for unclassified data, and banks used it for decades to protect PINs at cash machines. In 1976 Whitfield Diffie and Martin Hellman published a method for two parties to agree on a secret key over an open line, and in 1977 Ron Rivest, Adi Shamir and Leonard Adleman described RSA, the first widely used public-key cipher. Netscape introduced the Secure Sockets Layer for web browsers in the mid-1990s, which made online card payments practical; its successor, Transport Layer Security (TLS), reached version 1.3 in 2018. The Advanced Encryption Standard (AES) replaced DES as the US standard in 2001.

03

Symmetric and asymmetric encryption

Symmetric ciphers use one shared key to lock and unlock. A toy example is a letter shift: moving each letter three places turns "PAY" into "SDB", and shifting back three places decrypts it. Real symmetric ciphers such as AES scramble blocks of data through many rounds and are extremely fast, but both sides must already hold the same secret key.

Asymmetric, or public-key, ciphers use a pair: a public key that can be published and a private key kept secret. In RSA a message mm, written as a number, is encrypted with the public values ee and nn:

c=me mod nc = m^{e} \bmod n

and decrypted with the private value dd:

m=cd mod nm = c^{d} \bmod n
  • nn is the product of two secret prime numbers, pp and qq.
  • ee is the public exponent; dd is the private exponent, chosen so that e×de \times d leaves a remainder of 1 when divided by (p−1)(q−1)(p-1)(q-1).
  •  mod \bmod means "take the remainder after dividing by".

A worked example with tiny numbers: take p=5p = 5 and q=11q = 11, so n=55n = 55 and (p−1)(q−1)=40(p-1)(q-1) = 40. Choose e=3e = 3 and d=27d = 27, since 3×27=813 \times 27 = 81, which leaves 1 after dividing by 40. To send m=7m = 7, compute 73=3437^{3} = 343; dividing 343 by 55 leaves 13, so the ciphertext is 13. The receiver computes 1327 mod 5513^{27} \bmod 55, which equals 7, the original message. Real keys use numbers hundreds of digits long, which makes finding pp and qq from nn impractical for today's computers.

Public-key maths is slow, so practical systems combine the two: a public-key step agrees or delivers a fresh symmetric session key, and the bulk of the data is then encrypted symmetrically. The same key pairs also produce a digital signature, which proves who sent a message rather than hiding it.

04

Encryption in card and online payments

When a shopper pays on a website, the browser and the payment gateway open a TLS connection. The steps run in order:

  1. The browser and server exchange supported ciphers and the server presents a certificate containing its public key.
  2. The two sides run a key exchange to agree a shared session key that no eavesdropper can work out.
  3. The card's primary account number, expiry date and CVV travel encrypted with that session key.
  4. The gateway decrypts the data, then passes it on over separately encrypted links to the acquirer and card network.

In shops, card terminals encrypt PINs inside tamper-resistant hardware, and EMV chips use cryptographic keys to prove a card is genuine. Network tokenization adds a further layer by replacing the card number with a substitute value, so a stolen token is useless elsewhere. Bank-to-bank payment messages on networks such as SWIFT are likewise encrypted and signed in transit.

05

End-to-end encryption in messaging

TLS protects data between a device and a server, but the server can read it. End-to-end encryption goes further: only the sender's and recipient's devices hold the keys, so the service provider passes along ciphertext it cannot open. WhatsApp completed its rollout of end-to-end encryption based on the Signal Protocol in 2016, and many banking and payment apps use similar techniques for in-app chat. Encryption does not stop a user being tricked into sharing a code or approving a payment, which is why it is paired with multi-factor authentication and fraud monitoring, and why attackers increasingly target people rather than ciphers.

Last updated 13 Nov 2026