# Cryptography

Computer Science & Statistics at University of Rhode Island

Cryptography Concepts In cryptography three names appear everywhere. They are Alice, Bob, and Eve. Alice and Bob are friends exchanging encrypted messages. Eve is an eavesdropper, trying to break and read the messages being exchanged between Bob and Alice. Cryptographic algorithms can be categorized into two groups: symmetric (secret-key) and asymmetric (public-key) algorithms. In symmetric algorithms Bob need to send the key information to Alice or they have to agree on a single key in order to exchange messages. In asymmetric algorithms Bob will have two keys, a public key and a private key. Bob publishes his public key to every one. Alice uses Bobs public key to encrypt messages and sends them to Bob. Bob on receiving the message, uses the private key to decrypt them. Eve also has access to the Bobs public key but she cannot decrypt messages as she does not know Bobs private key and it is almost impossible to discover the private key with just the knowledge of the public key.
Symmetric Cryptosystem
Asymmetric Cryptosystem
Definitions -
**Cryptology**: The study of cryptography and cryptanalysis -
**Cryptosystem**: A cryptosystem is a system for encrypting and decrypting data -
**Cryptography**: The art or science concerning the principles, means, and methods for rendering plaintext unintelligible and for converting encrypted messages into intelligible form -
**Cryptanalysis**: The science of deducing the plaintext from a ciphertext, without knowledge of the key -
**Cryptographers**: -
**Cryptanalyst**: Practitioners of cryptanalysis -
**Encryption**: Encryption is the transformation of data, called**plaintext**, readable by anyone, into data, called**ciphertext**, which is only readable by those who have the knowledge of the secret decryption key -
**Decryption**: Decryption is the process of converting ciphertext into plaintext using the secret decryption key -
**Symmetric cryptosystem**: A cryptosystem that uses the same key for encryption as decryption. This is also called private key cryptosystem. Only people who are authorized to encrypt/decrypt the messages should know the key -
**Asymmetric cryptosystem**: A cryptosystem that had different keys for encryption and decryption and is impossible to derive the decryption key from the encryption key. This is also called the public key cryptosystem. For this system encryption key is made public and the decryption key is kept secret -
**Block cipher**: A cryptosystem in which encryption/decryption is done on blocks of data. The full message is divided into fixed length blocks, then each block is encrypted/decrypted and the blocks are grouped to get the plaintext/ciphertext -
**Stream ciphers**: An encryption method that uses continuous input, as opposed to fixed length blocks of data.
Cryptography algorithms are mathematically based and work with numbers. As a result, we need to convert text to numbers before using cryptography algorithms and then convert the resulting numbers back to text. We have used 3 methods for converting strings to numbers and vice-versa.
Example: a 0, b 1 .z 25
Example: a 000000, b 000001 z 011011, A 011010, B 011011 Z 110011, 0 110100 9 111101, comma 111110, period 111111.
Let Then
In public key cryptosystem most of the calculations are
done mod m, where
The size of the plaintext substring will be floor(log
Let plaintext =HIHB Let the formula for encryption is CT#
= (PT# * 21) mod First find the acceptable size of the substring =
floor(log HI = 7 * 26 HB = 7 * 26 Apply encryption formula = (215 * 21) mod 731 = 129 (33 * 21) mod 731 = 693 Using the size of 2 the zz represents the maximum number 25 * 26 |