# Cryptography

## Summary


**Cryptography** is a set of techniques for encrypting data using specified algorithms that make the data unreadable to the third party computer systems, unless decrypted using predefined procedures by the sender. Messages between the sender and receiver are passing through a medium, which may be attacked and the information can be stolen. So the sender encrypts and the receiver decrypts. In the presence of third parties, cryptography is the practise of secure communication. **Data encryption** is known for its ability to keep information safe from prying eyes. It uses an encryption key to convert data from one format, called plaintext, to another, called ciphertext. Modern cryptography is largely based on computer science's mathematical theory and practise.

## Discussion

### What is the purpose of cryptography?

A system's ability to verify the sender's identity is **Authentication**. The sender and recipient can verify each other's identities as well as the information's origin and destination.  

Information transmitted should only be accessed by legal parties and not by anyone else for the purpose of **Confidentiality**. Anyone who was not intended to get the information will be unable to comprehend it.  

Only authorised parties are allowed to make changes to transmitted data to maintain **Integrity**. Information cannot be manipulated with while in storage or in transmission between the sender and the intended recipient without being detected.  

**Non-repudiation** is the guarantee that no one can refute something's legitimacy. The information creator/sender cannot later contradict their intentions in the development or transmission of the material.  

The information provided is only accessible to those who have been given permission. This gives **Access Control** only to the involved parties. 


### What are some well-known applications of cryptography?

**Protected Communication:** Encrypting communications between ourselves and another system is the most common application of cryptography, and one we all use on a regular basis. A web browser and a web server are two examples, as are an email client and an email server. Modern switching networks make interception more difficult. 

**Storage Integrity:** The emergence of computer viruses has led to the adoption of cryptographic checksums for data storage. A checksum is generated and compared to expectations, just as it is for transmission integrity. Transmitted information is often available for a shorter amount of time and is used for a smaller volume of data, and is retrieved at a slower rate than stored data. 

**Electronic Money:** Today, there are patents in existence around the world that allow electronic information to substitute cash money in individual financial transactions. Cryptography is used in this system to keep national assets in electronic form. 


### Which are some commonly used terms in cryptography?

**Plaintext** refers to any communication or data that has to be protected for various reasons. 

**Ciphertext** is the unreadable form of data that is generated at the end of the encryption process. 

**Encryption** refers to the process of encoding a message with the use of a key. The basic text is turned into illegible text in this way. 

**Decryption** is the process of deciphering an encoded communication with the use of a key. It's the inverse of the encryption method. 

A **key** is a parameter that dictates what a cryptographic process's final output will be. The length of the key is important in the encryption process. 


### What techniques can be used for encrypting/decrypting data?

When **Symmetric Encryption** is performed, the same cryptographic keys are utilised for plaintext crypting and degradation of the figure materials. Symmetrical key encryption is less complicated. One key is used to encrypt and decrypt both data sets. Types of symmetric keys: Stream or Block cyphers, can be used in symmetric-key encryption. Stream cyphers encrypt the digits of a message one by one (typically bytes). To modify the component's measurement, Block figures employ distinct sections and encrypt them with the plaintext as a single component unit. 

**Asymmetric Encryption** is a collection of keys that are used to encrypt and decrypt public and private-key information.

Because the user utilises two keys as asymmetrical encoding employs two keys, it's also known as the Cryptography Public Key. 

In **Encryption with public keys** the messages are encrypted using the recipient's public key. The post cannot be deciphered by anyone who is not the private coordinator, does not own the key, or is not connected to the general public key. 

**Digital Signature** uses a personalised transmitter key that can be verified by anyone with a personal key, ensuring network security. 


### Could you share examples of cryptographic algorithms?

**Data Encryption Standard (DES)** developed by IBM in the 1970s, approved for commercial usage by the National Bureau of Standards(NBS) in 1977 uses a 56-bit key and 8 rounds to work on 64-bit blocks. 

**Advanced Encryption Standard (AES)** is a fast and safe algorithm released in 1998, created by Vincent Rijmen and Joan Daemen works with variable key and block lengths. The key length can be 128, 192, or 256 bits, and the block length can be 128, 192, or 256 bits. 

**Rivest Cipher (RC)** was created by Ronald Rivest, and named after him. RC1, RC2, RC3, RC4, RC5, and RC6 are available.

Bruce Schneie created **Blowfish** in 1993 and published it in 1994. It contains 8 rounds, with a 64-bit block size and a key length of 32 to 448 bits. Blowfish is considered as a replacement for DES as it is substantially faster than others with a good key strength.

**RSA** was named after it's inventors Ron Rivest, Adi Shamir and Leonard Adleman, in 1997. A variable-size key and encryption block are employed in it. It provides increased security and convenience, and uses Public Key Encryption.


### How do I evaluate cryptographic algorithms?

Each encryption algorithm has strengths and disadvantages, that affect encryption performance based on these parameters:

**Encryption time** is measured in milliseconds and depends on the data block's length and key. When the encryption time is short, an algorithm's performance is considered advanced. 

**Decryption time** is the amount of time it takes to recover the original text from ciphertext, measured in milliseconds. When the decryption time is short, an algorithm's performance is considered superior. 

**Memory used** should be minimal because it has an impact on system costs. 

**Throughput** is calculated by dividing the total encoded block size by the whole encode time. If the throughput cost rises, the algorithm's power consumption will fall. 

**Avalanche effect** predicts that if the plaintext changes, the ciphertext will also change dramatically, by calculating the difference between plaintext and ciphertext modifications. 

**Entropy** is a statistical measure of data randomness and uncertainty.. 

**The number of bits required for encoding optimally** defines the bandwidth required for transmission. When an encrypted character or bit is encoded with fewer bits, it uses less storage and bandwidth, directly impacting the system's cost. 


### What is the role of computational and energy costs in implementing Cryptography?

Networks are developing towards a ubiquitous model in which heterogeneous devices are networked (offering easy network interconnections anytime and anyplace). Cryptographic algorithms are necessary for the network security solutions' development. However, network devices' computational and energy restrictions make real implementation of such processes difficult. As a result, a thorough examination of the costs of launching symmetric and asymmetric cryptographic algorithms, hash chain functions, elliptic curve cryptography, and pairing-based cryptography on personal agendas is carried out, and the results are compared to the costs of basic operating system functions. The studies reveal that, while cryptographic power costs are considerable and such operations must be time limited, they are not the primary limiting factor in a device's autonomy. 

The technological advancement has resulted in the expansion of personal portable computers and the emergence of new forms of networks. Security solutions are required to secure heterogeneous ubiquitous networks generated by small and restricted devices, which are being explored or are already in use. The inherent nature of ubiquitous networks requires the safeguards' implementation to assure proper protocol execution at all layers, from networking operations to collaborative enforcement protocols or privacy-protecting mechanisms. 

## Milestones

1932

Polish cryptographer Marian Rejewski discovers how Enigma works. 

1939

Poland shares the information on how Enigma works with the French and British intelligence services, allowing cryptographers like Alan Turing to figure out how to crack the key, which changes daily. It proves crucial to the Allies' World War II victory. 

1945

Claude E. Shannon of Bell Labs publishes an article called "A mathematical theory of cryptography." It's the starting point of modern cryptography. For centuries, governments have controlled secret codes: applied to diplomacy, employed in wars, and used in espionage. But with modern technologies, the use of codes by individuals is exploding. 

1976

Whitfield Diffie and Martin Hellman publish a research paper, New Directions in Cryptography, on what would be defined as the Diffie-Hellman key exchange. For the first time, the code key is no longer pre-arranged, but a pair of keys (one public, one private but mathematically linked) is dynamically created for every correspondent.  

1977

RSA public key encryption is invented. 

1978

Robert McEliece invents the McEliece cryptosystem, the first asymmetric encryption algorithm to use randomization in the encryption process. 

2000

The Advanced Encryption Standard replaces DES, or AES (asymmetric key - the user and sender must know the same secret key), found through a competition open to the public. Today, AES is available royalty-free worldwide and is approved for use in classified US government information. PKI (Public Key Infrastructure) is a generic term used to define solutions creating and managing public-key encryption. It is activated by browsers for the Internet but also by public and private organizations to secure communications. 

2001

Belgian Rijndael algorithm selected as the U.S. Advanced Encryption Standard (AES) after a five-year public search process by National Institute of Standards and Technology (NIST). 

2004

The first commercial quantum cryptography system becomes available from id Quantique. 

2005

Elliptic-curve cryptography (ECC) is an advanced public-key cryptography scheme and allows shorter encryption keys. Elliptic curve cryptosystems are more challenging to break than RSA and Diffie-Hellman. 

2007

Users swamp Digg.com with copies of a 128-bit key to the AACS system used to protect HD DVD and Blu-ray video discs. The user revolt is a response to Digg's decision, subsequently reversed, to remove the keys, per demands from the motion picture industry that cited the U.S. DMCA anti-circumvention provisions. NIST hash function competition announced. 

2013

Edward Snowden discloses a vast trove of classified documents from NSA. Dual\_EC\_DRBG is discovered to have a NSA backdoor. NSA publishes Simon and Speck lightweight block ciphers.