Tuesday, June 7, 2011

MD5 (Message-Digest Algorithm 5)

MD5 (Message-Digest Algorithm 5)
MD5 is a cryptographic hash function widely used with 128-bit hash value. MD5 is used for security applications and for testing the integrity of a file.
Step-making MD5:
1. The addition of bits booster -> Message plus booster sejaumlah bit so that the message length congruent to 448 modulo 512. Long-bit booster is between 1 to 512.
2. Value Addition of Long Messages -> messages that have been given a booster bits with 64 bits plus a stated length of the original message. So the message length is now a multiple of 512 bits
3. Initialize MD Buffer -> MD5 requires 4 pieces of each buffer length of 32 bits. Fourth this buffer holds the intermediate results and final results
4. Processing messages in the block is 512 bits -> message is divided into blocks whose length x fruit each 512 bits. Each block of 512 bits processed together with MD into the output buffer 128 bits. This process is called the process HMD5
How it Works MD5
MD5 512-bit processing block is divided into 16 subblok size 32 bits. Algorithm output is set into 4 blocks each measuring 32-bit after combined will form a 128 bit hash value. 












Sunday, June 5, 2011

Hash Function Cryptography

Cryptographic hash function
Cryptographic hash function is a hash function that has some additional security properties that can be used for data security purposes. Generally used for authentication and data integrity. Hash function is a function that efficiently convert the input string with a string of finite length with fixed length output called the hash value.
Attributes Cryptographic Hash Functions

    
Hold preimej (Preimage resistant): if known hash value h is difficult (computationally not feasible) to obtain m where h = hash (m).
    
Hold second preimej (Second preimage resistant): if known input is difficult to find inputs m1 m2 (not equal to m1) which causes the hash (m1) = hash (m2).
    
Hold collision (Collision-resistant): difficult to find two different inputs m1 and m2 that causes hash (m1) = hash (m2)
Understanding MD5:
Understanding MD5 (Message-Digest algortihm 5) is a cryptographic hash function widely used with 128-bit hash value (source: wikipedia). MD5 Password is one of protection to the user in using the internet facilities in cyberspace, especially those associated with passwords, because a password is the key that is very valuable for us who frequently perform activities in cyberspace, we can imagine if a cracker can break through the website database such as government sites that are highly confidential and crackers are looking for a bug from the target site with a variety of methods / hacking techniques (such as: SQL Injection, Keyloggers, Social Engineering, Trojan Horse, DDOS, etc.) so that a cracker can penetrate into the database and get the password the victim in form of hash, and if successful steal password hash in the form of a total of 32bit (example hash: fdf0ef0ea5c1620f77107f3f1047fb4c) it can easily encrypt the password MD5 hash result are living in decrypted into plain text form (plain text) by using the tools / software that can be downloaded free from uncle google and website service providers to decrypt a password MD5 hash the actual password, thereby automatically the crackers were free to do all the things she wants like a steal data, modify data, alter the look of a website (deface) and even just shut it just because its main purpose is to test the security of the target site alone and to satisfy her curiosity until he could penetrate its database and does not intend to destroy, after a database impenetrable abandoned, usually it is done by a hacker group white (WhiteHat .)
A brief history of MD5 in starting in 1991 which was designed by prof. Ronald Rivest of the university in the United States of MIT, Prof.. Ronald Rivest designed the MD5 because it has found a weakness in MD4 found Hans Dobbertin. In 1996, Hans Dobbertin found a damage / crack the MD5 compression function, but this is not an attack on the MD5 hash completely, so she announced to the users of cryptography suggested that change with Whirlpool, SHA-1, or RIPEMD-160.
But gradually MD5 can no longer be relied upon because the encrypted MD5 hash result of the damage and begin to reveal a secret known to the MD5 algorithm, it was discovered the damage on August 17, 2004 by Xiaoyun Wang, Dengguo Feng, Xuejia Lay and Hongbo Yu, judging from their name comes from Chinese bamboo curtain country, just info only that the attack did they do to be able to decrypt the MD5 hash to plain text only takes one hour, using an IBM P690 cluster.
Understanding SHA
Secure hash algorithm is an algorithm slah hash function in use. SHA is a one-way hash function created by NIST and in use with the DSS (digital signature standard). SHA is based on MD4 which is made by Ronald L. Rivest. SHA called safe (secure) because in a way that the design sedimikian computationally impossible to find messages that correspond with the message in gest that in brikan.
The steps in the SHA-1 is as follows:  

 1. Doing so padding to the message length is 448 modulus 512. 64 bit binary representation of the rest is a long message. Doing inisialisasi5 word buffer (160 bits) A, B, C, D, and E with an A = 67452301, B = efcdab89, C = 98badcfe, D = 10,325,476, and E = c3d2e1f0.
    
Process message in 16 word blocks (512 bits) with the provisions
        
Expansion of 16 words to 80 words by mixing and shifting techniques.
        
Using four rounds of 20 bit operations on message block and buffer.
        
Adding the output with the input to buffer the new value mempeoleh
    
The output hash value is the final value of the buffer.
So basically the SHA-1 is a hash algorithm that maps an arbitrary length input string to be output with the 160-bit fixed length.

Friday, June 3, 2011

ElGamal Algorithm

ElGamal algorithm is one of public-key cryptography algorithm created by Taher ElGamal in 1984. Algorithm in the generally used for digital signatures, but later modified so that also could be used for encryption and description. ElGamal is used in security software developed by GNU, PGP programs and other security systems. The strength of this algorithm lies in the difficulty of calculating discrete logarithms.
ElGamal algorithm is not patentable. However, this algorithm is based on the algorithm Diffie - Hellman, so the algorithm patents Diffie - Hellman also include ElGamal algorithm. Due to patent the algorithm Diffie - Hellman ended in April 1997, the ElGamal algorithm can be implemented for commercial applications.
Quantities used in the ElGamal algorithm:
1. Prime numbers, p (not secret)
2. Random numbers, g (g <p) (not secret)
3. Random numbers, x (x <p) (confidential) 
4. M (plaintext) (confidential) 
5. a and b (ciphertext) (no secret)
 
Procedures Creating Key Pairs
· Select an arbitrary prime number p.
· Select two random numbers, g and x, provided g <p and 1 ≤ x ≤ p - 2.
· Compute y = gx mod p.
Public key is y, the secret key is x. Value of g and p are not confidential and can be announced to members of the group.
Encryption
· Plaintext arranged into blocks m1, m2, ..., such that each block represents the value in the range 0 to p - 1.
· Select k random numbers, which in this case £ 0 k £ p - 1, such that k is relatively prime with p - 1.
· Each block is encrypted using the formula m
a = gk mod p
b = ykm mod p
Pairs a and b is the ciphertext for block a message m. Thus, the size twice the size plainteksnya ciphertext.
Decryption
To decrypt a and b use a secret key, x, and the plaintext m is obtained again by equation
m = b / ax mod p
Note that because
gkx º ax (mod p)
then
b / ax º ykm / ax
º gxkm / gxk
º m (mod p)
which means that the plaintext can be recovered from ciphertext pairs a and b.




Flowchart



Examples

Siti want to generate the key pair. Siti chose p = 2357, g = 2 and x = 1751. Then calculate:

y = gx mod p = 21 751 mod 2357 = 1185

So the public key (y = 1185, g = 2, p = 2357) and the corresponding private key (x = 1751, p = 2357).

Encryption

Suppose Ahmad wants to send palinteks m = 2035 (m value was still inside the interval [0, 2357-1]). Ahmad choose a random number k = 1520 (k values ​​are still in the interval [0, 2357-1]). Then calculate Ahmad

a = gk mod p = 21 520 mod 2357 = 1430

b = ykm mod p = 11851520 × 2035 mod 2357 = 697

Thus, the resulting ciphertext is (1430, 697). Ahmad send this ciphertext to Siti.

Decryption

Siti describe ciphertext of Ahmad by calculating as follows:

1/ax = (ax) - 1 = ap - 1 - x mod p = 1430605 mod 2357 = 872

m = b / ax mod p = 697 × 872 mod 2357 = 2035

The decrypted plaintext, 2035, the same plaintext sent by Ahmad.



Thursday, June 2, 2011

RSA (Rivest-Shamir-Adleman)

RSA algorithm was introduced by three researchers from MIT (Massachusetts Institute of Technology), namely Ron Rivest, Adi Shamir, and Len Adleman, in 1976. RSA encryption and decryption process based on the concept of prime numbers and modulo arithmetic. Both encryption and decryption keys are both integers. Encryption key is kept secret and public knowledge (so-called public key), but the key to decrypt the secret. Decryption key is made of several prime numbers together with the encryption key. To find the decryption key, a number is composite must be factored into prime factors. In fact, factoring nonprime numbers into prime factors is not easy. Currently no efficient algorithm found in factoring it. The greater number of the more difficult it nonprimanya pemfaktorannya. The more difficult pemfaktorannya, the stronger the RSA algorithm. In summary, the RSA algorithm is as follows. 

Strength and RSA Security As mentioned previously, the strength of the RSA algorithm lies in the level of difficulty of factoring numbers nonprime prime factor, which in this case n = ab. Once successfully factored n, then m = (a - 1) (b - 1). Furthermore, because the encryption key e is not suppressed, then the decryption key d can be calculated as well. This means that the decryption process can be done by people who are not eligible.
The inventor of the RSA algorithm suggests the value of a and b whose length is more than 100 digits. Thus the time will be measuring more than 200 digits. According to Rivest et al. for factoring numbers effort requires computation time for 4000 years! (Assuming a clock speed of the computer used 1 GHz).
Fortunately most efficient algorithm for factoring large numbers has not been found. This is what makes the RSA algorithm, but used as a powerful tool!
Suggestions to utilize and strengthen your RSA algorithm in processing files In processing the file, which is processed every byte. In a text file, byte represents a character. Compared with other cryptographic algorithms, file processing with the RSA algorithm requires a longer time. Thus, the plaintext and ciphertext blocks are used, it suggests the values ​​of each byte (from 0 to 255). However, if niali direct byte is used as a block, maybe there will still be leaked, because chiperteks to the same byte is the same. Therefore, the algorithm should be added to read two or more bytes at a time who later manipulate the bytes in such a way / trick that is unusual, provided that such manipulation must be reversible because it will use encryption and decryption algorithm inverse to each other. Thus, 99.99% guaranteed there can be no successful break.




Advanced Encryption Standard (AES) is a standard symmetric-key encryption with that adopted by the government of the United States. This standard consists of 3 block cipher, namely AES-128, AES-192 and AES-256, which was adopted from a larger collection that was originally published as Rijndael. Each cipher has a size of 128-bits, with each key size 128, 192, and 256 bits. AES has been analyzed extensively and is now used throughout the world, like its predecessor, the Data Encryption Standard (DES).
AES was announced by the National Institute of Standards and Technology (NIST) as Federal Information Processing Standards (FIPS) publication 197 (FIPS 197) on November 26, 2001 after the standardization process for 5 years, in which there are 15 designs are presented and evaluated encryption, before Rijndael selected as the most suitable. AES effectively become the standard of the Federal government on May 26, 2002 after approval from the Ministry of Trade. AES encryption is available in a variety of different packages. AES is a standard first publicly accessible and open password-approved by NSA for classified information.

Rijndael was developed by two Belgian cryptographers, Joan Daemen and Vincent Rijmen, and submitted by them to the AES selection process. Rijndael (pronounced [rɛinda ː l]) is a play on words from the name of the inventor.

The process shifts in the AES
There are 10, 12, or 14 rounds (round) in the AES. Total orbit is consistent with the key size used.
Each orbit contain adequate:

    
Replacement Byte same as DES
    
Transition = Exchange line
    
Mix the Transition Path = Left & XOR bits.
    
The addition of subkeys = XOR Section Key with Decision orbit
Image Process Shift in AES
 
 
 

Wednesday, June 1, 2011

Blowfish Encryption

Blowfish, aka "OpenPGP.Cipher.4" is included in the class encryption Symmetric Cryptosystem, the encryption method is similar to DES (DES-like cipher) Cryptanalyst created by a company named Bruce Schneier President Counterpane Internet Security, Inc. (consulting company about cryptography and security Computers) and published in 1994. Created for use on computers that have a large microposesor (32-bit and above with a large data cache).
Blowfish was developed to meet the design criteria that fast in implementation which in optimal conditions can reach 26 clock cycles per byte, compact in which the memory can run at less than 5 MB, so simple in the algorithm is easy to determine fault, and security in which the variable key length varies ( minimum of 32 bits, 448 bits maximum, Multiple 8 bits, default 128 bits). Blowfish are optimized for applications where the key does not change frequently, as in the communication network or encrypt files automatically. Its implementation in bermicroprosesor 32-bit computer with a large data cache (Pentium and Power PC) Blowfish proved much faster than DES. But the Blowfish did not match the application with the key change that often or as Hast one-way functions such as packet switching applications. Blowfish was not to be used in smart card applications (smart cards) because it requires large memory.
Blowfish block cipher encryption is included in the 64-bit key length view varied between 32-bit to 448-bit.Algoritma Blowfish consists of two parts:
1.Key-ExpansionChange function key (Minimum 32-bit, Maximum 448-bit) into several subkey arrays (subkey) with a total of 4168 bytes.
2.Enkripsi DataIteration consists of a simple function (Feistel Network) 16 times round. Each round consists of key-dependent permutation and substitution of key-and data-dependent. All operations are the addition (Addition) and XOR on 32-bit variable. Additional operations are four search table (lookup table) indexed array for each round.
Blowfish algorithm
Blowfish uses a large subkeys. The key is to be calculated before encryption or decryption of data.
Blowfish is a Feistel network algorithms that apply (Feistel Network) which consists of 16 rounds. Input is 64-bit elements, X. For the groove Blowfish encryption algorithm with a method described as follows:
P-arrays 1.Bentuk initials as many as 18 pieces (P1, P2, ... ... ... ... .. P18) are msingP-value 32-bit.Array consisted of eighteen 32-bit key subkey:
P1, P2, ... ...., P18
2.Bentuk S-box of 4 pieces each worth 32-bit with input256.
Four 32-bit S-boxes each having 256 entries:
S1, 0, S1, 1, ... ... ... ... ... ... .., S1, 255
S2, 0, S2, 1, ... ... ... ... ... ... .., S2, 255
S3, 0, S3, 1, ... ... ... ... ... ... .., S3, 255
S4, 0, S4, 1, ... ... ... ... ... ... .., S4, 255
3.Plaintext to be encrypted is assumed as an input, the plaintexttaken as many as 64-bit, and if less than 64-bit then we addbits, so that in later operations in accordance with the data.
4.Hasil decision had been divided by 2, 32-bit first called XL, a second 32-bitcalled XR.
5.Selanjutnya do surgery Pi xor XL = XL and XR = F (XL) xor XR
6.Hasil from above operrasi exchanged into XR and XR XL into XL.
7.Lakukan 16 times, repeating that the 16 do again the process of exchange XLand XR.
8.Pada-17 process to do surgery to XR = XR xor P17 and P18 XL = XL xor.
Re-united last 9.Proses XL and XR to become 64-bit back.

Tuesday, May 31, 2011

DES(Data Encryption Standard)


DES algorithm developed at IBM under the leadership of WL Tuchman in 1972. This algorithm is based on the Lucifer algorithm, which is made by Horst Feistel.

This algorithm has been approved by the National Bureau of Standards (NBS) after its power rating by the National Security Agency (NSA), the United States.

DES included in symmetric cryptographic systems and classified as the type block ciphers.

DES operates on 64 bit block size. 64 bit DES encryption to 64 bits of plaintext to ciphertext using a key 56-bit internal (internal key) or upa-key (subkey). Internal key generated from an external key (external key) whose length is 64 bits.

the global scheme of the DES algorithm is as follows (see Figure 1):
1. Dipermutasi plaintext block with initial permutation matrix (initial permutation or IP).
2. The result of initial permutation and then in-enciphering-16 times (16 rounds). Each round uses a different internal keys.
3. Results enciphering then dipermutasi with permutation matrix inverse (or inverse initial permutation IP-1) into ciphertext blocks.


Figure 1. Global scheme of the DES algorithm


In the process of enciphering, plaintext block is divided into two parts, left (L) and right (R), each 32 bits in length. Both parts are entered into the 16 rounds of DES.

In each round i, block R is an input to the transformation function called f. In function f, R block combined with an internal key Ki. Dai output function f is XOR with a block of the block R L to get a new one. Meanwhile, a new block of L was taken directly from the previous R block. This is one round of DES.

Mathematically, one round of DES is expressed as

Li = Ri - 1
Ri = Li - 1 + f (Ri - 1, Ki)

Figure 2 shows the scheme of the DES algorithm which is more detailed.


Figure 2. DES Algorithm Encryption