# Introduction to Cryptography

Cryptography is the practice and study of hiding information. It uses encryption and decryption techniques. Encryption is the conversion of information from a readable state to nonsense. Only the receiver has the ability to decrypt the information. Between encryption and decryption cryptography avoids unwanted persons being able to read the information, increasing confidentiality. A cipher is a pair of algorithms that create the encryption and decryption. The operation of a cipher is controlled both by the algorithm and by a key. The key is a secret parameter known only to the sender and receiver, much like the key of a mechanical lock. Cryptography has become a widely used tool in communications, computer networks, and computer security generally.

**Symmetric key encryption **

Symmetric-key cryptography is an encryption method where both the sender and receiver share the same key. Symmetric-key cryptography relates mainly to block ciphers and stream ciphers. A block cipher takes as input a block of plaintext and a key, and outputs a block of cipher text of the same size. Several block encryption systems have been developed. The Data Encryption Standard (DES) and the Advanced Encryption Standard (AES) are the most popular block cipher designs. Despite its deprecation as an official standard, DES (especially its still-approved and much more secure triple-DES variant) remains quite popular. It is used across a wide range of applications, from ATM encryption to e-mail privacy and secure remote access. Stream ciphers, in contrast to block ciphers, create an arbitrarily long stream of key material, which is combined with the plaintext bit-by-bit or character-by-character. In a stream cipher, the output stream is created based on a hidden internal state which changes as the cipher operates. That internal state is initially set up using the secret key material. RC4 is a widely used stream cipher.

**Public key encryption **

A significant disadvantage of symmetric key encryption is the key management necessary to use them securely. Each distinct pair of communicating parties must share a different key. The number of keys required increases as the square of the number of network members, which very quickly requires complex key management schemes to keep them all straight and secret. The difficulty of securely establishing a secret key between two communicating parties, when a secure channel does not already exist between them, also presents a chicken-and-egg problem which is a considerable practical obstacle for cryptography use in the real world. In public key (also, more generally, called asymmetric key) cryptography two different but mathematically related keys are used: a public key and a private key. The public key may be freely distributed, while its paired private key must remain secret. Because public key cryptography is a very slow process (about 1000 to 10,000 times slower than symmetric key encryption), it is mostly used to setup a channel between two parties, to safely exchange a symmetric key, solving the chicken-and-egg problem explained above. After exchanging symmetric keys the rest of the communication is done using symmetric key encryption. Here is how it works:

- Party A creates a random secret key and encrypts it using the public key from Party B.
- The encrypted secret key is sent to party B using an open channel (like the Internet).
- Party B is the only party that can decrypt the message, because he has his private key that is related to the published public key. Party B decrypts the message and now knows the secret key.
- A and B start communicating using symmetric key encryption using the exchanged secret key.

Diffie–Hellman and RSA algorithms, in addition to being the first publicly known examples of high quality public-key algorithms, have been among the most widely used.

**Hash functions and digital signatures **

Hash functions take a message of any length as input, and output a short, fixed length hash which can be used in (for example) a digital signature. For good hash functions, an attacker cannot find two messages that produce the same hash. To create a digital signature, a hash is created of some text (like an email) and encrypted with the private key of the sender. The receiver decrypts the hash key using the sender's public key. He also calculates the hash of the text and checks it with the decrypted hash to ensure the text wasn't tampered with. MD5 is a very popular hash function. SHA-1 is also widely deployed and more secure than MD5. Digital signatures are described in the DSS standard. RSA and DSA are two of the most popular digital signature schemes. Digital signatures are central to the operation of public key infrastructures and many network security schemes (e.g., SSL/TLS, many VPNs, etc.).

This entry was posted on Friday 04 February 2011