Cryptography is the art and science of concealing the messages to introduce secrecy in information. Mathematical techniques are used to encrypt and decrypt data.

Cryptography is derived from the Greek words: kryptós, which means “hidden”, and gráphein, meaning “to write” or “hidden writing”.

Basically cryptography is the art and science of keeping messages secure.

A brief history of cryptography:

As you know evolution of human beings and civilization have always led to grouping of people (tribes and kingdoms). All this has continually led to battles, supremacy, politics and struggle for power.

- Read: What is Cryptanalysis.

These problems have created the need for people to communicate secretly, thus the evolution of cryptography.

Cryptography can be traced in early Roman and Egyptian civilizations. For example Hieroglyphic was used by Egyptians like 4000 years ago for communication and sending messages written in hieroglyph.

- Read: List of Ciphers.

Also Julius Caesar used a shift of 3 on the alphabet for encryption of messages for military purposes. His technique of encryption is called Caesar Cipher.

Lastly a known substitution technique called Kamasutra cipher was used around 400 BC, to teach women how to hide secret messages from prying eyes.

## Introduction to Cryptography

In this guide I will be discussing the following:

- The Basic Principles.
- Types of Cryptography.

### 1) The Basic Principles

- A
**cipher**is an algorithm used for performing both the encryption and decryption. **Plaintext**refers to the message in it’s original form before encryption has been done.**Ciphertext**refers to the unreadable scrambled message after the encryption process.- A
**key**is a secret string of characters, more like a password that is used during both encryption and decryption. **Encryption**refers to the process of encoding data and information to secure it.**Decryption**is the reverse of the encryption and often involves the uses of the same key used during the encryption.**Cryptanalysis**is the art of breaking ciphers and codes without the initial knowledge of the key.**Steganography**is a subfield of cryptography, that deals with hiding the existence of a message but not the content of the message itself (often with microdots and invisible inks).- A
**cryptosystem**is the use of cryptographic techniques and development of a good infrastructure for secure information systems.

#### Commons goals in cryptography

**Confidentiality of message**(privacy), meaning that only the authorized recipient should have access to the message.**Integrity of message**, meaning that the recipient should be able to determine whether the message has been altered.**Authentication of the sender**, meaning that the recipient should be able to verify from the message (the origin and the sender of the message).**Non-repudiation of the sender**, meaning that the sender should not be able to deny sending the message.**Access control****of****the message**, to identify the valid recipients of the message.**Availability of the message**, determines the validity limit of the message based on, channel and time.

### 2) Types of Cryptography

Here are the three types of cryptography techniques:

#### Symmetric Key Cryptography

Symmetric Key Cryptography is an encryption system in which the sender and the receiver of the message share a single, common key that is used to encrypt and decrypt the message.

It goes with other names like (Secret Key Cryptography, Conventional Cryptography, Secret Key algorithm and symmetric algorithm).

A key in this case is a piece of information (a parameter) that determines the functional output of a cryptographic algorithm or cipher.

The key for encrypting and decrypting the file have to be known to all the recipients. Else, the message can not be decrypted by conventional means.

Here are examples of Symmetric Key Cryptography:

**Data encryption standard (DES)**

The Data Encryption Standard was published in 1977 by the US National Bureau of Standards. DES uses a 56 bit key and maps a 64 bit input block of plaintext onto a 64 bit output block of ciphertext. 56 bits is a small key compared to today’s computers that have better processing power.

**Triple DES**

Triple DES was the answer to many of the shortcommings of DES. Since it is based on the DES algorithm, it’s very easy to modify existing software to use Triple DES.

It also has the advantage of proven reliability and a longer key length that eliminates many of the shortcut attacks that can be used to reduce the amount of time it takes to break DES.

**Advanced Encryption Standard (AES)**

Advanced Encryption Standard (AES) is an encryption standard adopted by the US government. The standard comprises three block ciphers, AES-128, AES-192 and AES-256, adopted from a large r collection originally published as Rijndael.

Each AES cipher has a 128-bit block size, with key sizes of 128, 192 and 256 bits, respectively. The AES ciphers have been analyzed extensively and are now used worldwide, as was the case with its predecessor, the Data Encryption Standard (DES).

**International Data Encryption Algorithm (IDEA)**

The international Data Encryption Algorithm was developed in 1991. It uses a 128 bit key to encrypt a 64 bit block of plaintext into a 64 bit block of ciphertext.

IDEA’s general structure is very similar to DES, it performs 17 rounds, each round taking 64 bits of input to produce a 64 bit output, using per-round keys generated from the 128 bit key.

Other examples of symmetric key cryptography include: Lucifer, Madryga, FEAL, REDOC, LOKI, GOST, CAST, Blowfish, Safer, Crab, RC5 and many others.

#### Asymmetric Key Cryptography

Asymmetric cryptography, also known as public-key cryptography, refers to a cryptographic algorithm which requires two separate keys, one of which is private and one which is public.

The public key is used to encrypt the message and the private one is used to decrypt the message.

Public Key Cryptography is a very advanced form of cryptography. It was invented by Whitfield Diffie and Martin Hellman in 1975.

The basic technique of public key cryptography was first discovered in 1973 by the British Clifford Cocks of Communications-Electronics Group (CESG) of (Government Communications Headquarters – GCHQ) but kept secret until 1997.

Here are examples of Asymmetric Key Cryptography:

**Digital Signature Standard (DSS)**

Digital Signature Standard (DSS) is the digital signature algorithm (DSA) developed by the US National Security Agency (NSA) to generate a digital signature for the authentication of electronic documents.

DSS was put forth by the National Institute of Standards and Technology (NIST) in 1994, and has become the United States government standard for authentication of electronic documents. DSS is specified in Federal Information Processing Standard (FIPS) 186.

**RSA – algorithm**

RSA (Rivest, Shamir and Adleman who first publicly described it in 1977) is an algorithm for public-key cryptography.

It is the first algorithm known to be suitable for signing as well as encryption, and one of the first great advances in public key cryptography.

RSA is widely used in electronic commerce protocols, and is believed to be secure given sufficiently long keys and the use of up-to-date implementations.

**ElGamal**

ElGamal is a public key method that is used in both encryption and digital signing. The encryption algorithm is similar in nature to the Diffie-Hellman Key agreement protocol.

It is used in many applications and uses discrete logarithms. ElGamal encryption is used in the free GNU Privacy Guard software.

#### Hash Functions

**What is a hash function?**

A cryptographic hash function is a hash function that takes an arbitrary block of data and returns a fixed-size bit string, the cryptographic has value, such that any change to the data will change the hash value.

The data to be encoded are often called the message, and the hash value is sometimes called the message digest or simply digest.

Here are the four main properties of an ideal cryptographic hash function:

- It is easy to compute the hash value for any given message.
- It is infeasible to generate a message that has a given hash.
- It is infeasible to modify a message without changing the hash.
- It is infeasible to find two different messages with the same hash.

Here is an example of hash function:

**SHA**

The Secure Hash Algorithm (SHA) hash functions are a set of cryptographic hash functions designed by the National Security Agency (NSA) and published by the NIST as a US Federal Information Processing Standard.

SHA stands for Secure Hash Algorithm.

Because of the successful attacks on MD5, SHA-0 and theoretical attacks on SHA-1, NIST perceived a need for an alternative, dissimilar cryptographic hash, which became SHA-3.

In October 2012, the National Institute of Standards and Technology (NIST) chose the Keccak algorithm as the new SHA-3 standard.

Read: Types of hash functions with examples complete list.

Now I want to hear from you.

What do you think of this quick intro to cryptography guide?

Or maybe I missed an important aspect of how cryptography has evolved.

Either way, let me know by leaving a comment below.