Thursday, October 29, 2009

Modern Cryptography

Modern Cryptography use a sequence binary such as ASCII that represent each character in the computer keyboard. there are 2 algorithm that popular and being use now :

1. Stream Cypher is a symmetric key cipher where plaintext bits are combined with a pseudorandom cipher bit stream (key stream), typically by an exclusive-or (xor) operation. In a stream cipher the plaintext digits are encrypted one at a time, and the transformation of successive digits varies during the encryption. It also generates successive elements of the keystream based on an internal state. This state is updated in essentially two ways: if the state changes independently of the plaintext or ciphertext messages, the cipher is classified as a synchronous stream cipher.

a.Synchronous stream ciphers : stream of pseudo-random digits is generated independently of the plaintext and ciphertext messages, and then combined with the plaintext (to encrypt) or the ciphertext (to decrypt).


b. Self-Synchronous stream ciphers : has the advantage that the receiver will automatically synchronise with the keystream generator after receiving N ciphertext digits, making it easier to recover if digits are dropped or added to the message stream. Single-digit errors are limited in their effect, affecting only up to N plaintext digits.


2. Block Cipher is a symmetric key cipher operating on fixed-length groups of bits, termed blocks, with an unvarying transformation. A block cipher encryption algorithm might take (for example) a 128-bit block of plaintext as input, and output a corresponding 128-bit block of ciphertext. The exact transformation is controlled using a second input — the secret key. Decryption is similar: the decryption algorithm takes, in this example, a 128-bit block of ciphertext together with the secret key, and yields the original 128-bit block of plaintext and to encrypt messages longer than the block size. There are 2 type:

a. DES (Data Encryption Standard) : The plaintext is divided into 64 bit block with a key of 56bits ( 8 bit parity) and will go through 16 round of expansion, substitution, key mixing and permutation process.

b. RSA ( Rivest, Shamir, Adleman) : algorithm that been use 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.Widely used in electronic commerce protocols, and is believed to be secure given sufficiently long keys and the use of up-to-date implementations.


RSA Key Setup Example :

1.Select primes: p=17 & q=11
2.Compute n = pq =17 x 11=187
3.Compute ΓΈ(n)=(p–1)(q-1)=16 x 10=160
4.Select e: gcd(e,160)=1; choose e=7
5.Determine d: de=1 mod 160 and d < 160 Value is d=23
6.Publish public key PU={7,187}
7.Keep secret private key PR={23,187}


Hash Function : mostly used to speed up table lookup or data comparison tasks — such as finding items in a database, detecting duplicated or similar records in a large file, finding similar stretches in DNA sequences, and other that related. It also any well-defined procedure or mathematical function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an index to an array. The values returned by a hash function are called hash values, hash codes, hash sums, or simply hashes. It must have this 4 criteria:
- easy to compute the hash value for any given message.
-
infeasible to find a message that has a given hash
-
infeasible to modify a message without changing its hash
-
infeasible to find two different messages with the same hash



No comments:

Post a Comment