Search This Blog

Showing posts with label encrypt. Show all posts
Showing posts with label encrypt. Show all posts

Tuesday, February 2, 2010

Simulation of ElGamal Cryptography

The following are examples of simulation programs ElGamal cryptography. This program is made with JAVA programming language, and its design interface with Net bean. You can download the project files (Indonesian version) here. click here to download

Generate Trigger Numbers

In ElGamal fruit numbers are 2 triggers, namely g and k. both must be excellent and worth less than the range of data or p. Numbers g are constants or fixed. So in this final project in the initial g value 13. The value of k is a variable or change 1 change for each plain text character.
In this final project in the form k do in a class GenerateK. Program listing is

public class GenerateK {

double kb ; double kx = 0;

public double setK (){ int prima =0;

while(prima == 0){

kx = (Math.random()*221)+1; prima = cekprima (kx); } return kx; }

public double getK (){

kb = setK(); return kb; }

private static int cekprima(double ky){

int ky1 = (int)ky; int sip =1;

int batas = (int) Math.ceil(ky/2);

if((ky1==1)||(ky1==2)){

sip=1;}

else{

for(int i=2;i <= batas;i++){

int tes = ky1 % i;

if(tes==0){sip = 0; break;}

else sip =1;} }

return sip;}}

call class is conducted generateK random integer value between 1 and 222. Then the numbers k will be test in prime testing. Prime test is testing whether an integer k prime or not, by way Modulo operations with numbers number k 2 to k \ 2. If the modulation is always not equal to zero, k can be considered prime. But if one Modulo operations produce zero, k is not prime. If it does not fit the random re-done to produce a prime k.
To get the number k, after GenerateK create a new object, do the calling method getK (). The following example program listing:


800x600

GenerateK bikink = new GenerateK ();

double kd = Math.ceil(bikink.getK());

int k = (int) kd - 1;


in decrypt and encrypt process you can lean more in the file download



Saturday, September 12, 2009

Encryption PGP (Pretty Good Privacy)


BASIC THEORY



" PGP" (Pretty Good Privacy) is a type of encryption used for encrypting email. created by Phil Zimmerman . Cryptography is best to use. The software also has some integrated one program, also available in the Linux Operating System environments and Windows. Actually, it's free but there are versions that must be paid.
When you use "PGP" you have to have the data in binary form to be sent. So for email delivery at only design in the form of text. "PGP" also makes an encrypted message in the form of a segment if the file is too large.
Working principle of this algorithm "PGP" is when we apply this algorithm to send a message to our friends, "PGP" keys to make 2 pieces of public key and private key (Example Bob And Alice) and Bob and Alice will exchange their public keys.
When Alice sends Bob an email to the email will be encrypted with Bob's public key and Bob's Private Key, then the email will be sent through the network. If BOB wants to read the email then Bob must have a public key and the Allice key Private own.

Monday, September 7, 2009

What is Cryptography?

Cryptography is the art of encoding information by using specific techniques with the aim of such information can only be known and read by the right side. Cryptography is not merely technical, but also an art. This is because an attempt to break the password is also directly proportional to the effort encrypting, or even more. In its development so that any attacker (person who wants to break the cryptographic code) which called "cryptanalysis" and the cryptographers (principals cryptography) is always locked on each others creativity to each technique.

But the science of cryptography can not be separated from the engineering sciences. Particularly modern cryptography which relies heavily on mathematics. In contrast to the more classical cryptography technique modification of existing data in order not to be recognized. In this book we will be much talk about discrete mathematics which became a mainstay of "ElGamal" cryptography.

Actually there is science in addition to other cryptography to encrypt data that is stenography, which is a data encryption technique with increasing data - other data or abbreviate the data with a specific pattern. Examples of the shorthand is Digital watermarking. Explanation of stenography will be discussed in the chapter on stenography.

Cryptography itself divided by the time period Type 2, namely:

1. Classical cryptography.
2. Modern cryptography.

Meanwhile, if divided by type of cryptographic keys are used, then the cryptography is also divided by 2 is:

1) Symmetric Cryptography
2) asymmetric Cryptography

Cryptography is also divided based on 2 sharing data will be processed, namely:

1. Cryptography Chipper Block
2. Cryptography Stream

Thursday, August 13, 2009

Ensuring Security Cryptography

In this world there are some parties who want to take information from chipertext already in cryptography. party called kriptanalis.
Kriptoanalisis also be defined as art or science to solve ciphertext become plaintexts using the midst security a cryptography system. This makes Kriptoanalisis labeled as illegal ways to translate ciphertext. Based on the activities of attackers, the attack that occurred can be divided into two types, namely:

a) passive attacks, where attack is attacker only monitors the channel communication. Passive attacker only threaten confidentiality of data.

b) active attacks, where attack is
attacker trying to remove, add, or in a way that another change in the transmission path of communication. Active attacker will threaten data integrity and authentication, and confidentiality.


Types of Seizures
There are several types of attacks that can be done by kriptoanalis, with the assumption that kriptoanalis had cryptography algorithm used in the system that will be attacked, namely:

1. Ciphertext Only Attack
'Kriptoanalis' only have a few ciphertext a result of tapping. But he does not know the key and the plaintext. Employment 'kriptoanalis' is seeking to obtain the decryption key the plaintext.

2. Known Plaintext Attack
Kriptoanalis successfully obtain discount
the plaintext and a full the chipertext, but he believes that both are interconnected. For example, the snippet plaintext which is believed to be a letter, because there is the phrase "respect us." 'Kriptoanalis' then try to match the chipertext that have meaning "respect us." Next task is to find a little of the decryption key information that he had it.

3. Candy Plaintext Attack
"Kriptoanalis" not only know a plaintext and the chipertext as in the case 2 above, but also free to choose some plaintext considered in accordance with a certain part of ciphertext. "Kriptoanalis" next task is to a key of guess.

4. Adaptive Candy Plaintext Attack. This attack is a special case of third type of attack mentioned above. "Kriptoanalis" not can only select a the plaintext would be encrypted, but can also modify choice based on the results of previous encryption. In Candy the plaintext attack, it may only can select a block for large plainteks encrypted, while he is on the attack can block plaintext choose a smaller and then select the other based on the results previously.

5. Candy Ciphertext Attack
"Kriptoanalis" can choose which ciphertext different decryption and to have access against plaintext encrypted. As example, "kriptoanalis" have access to the box
electronic process that can perform decryption automatically. Employment is "kriptoanalis" find the decryption key.

6. Candy Text
Candy is a combination of plaintext attack Candy and ciphertext attack. Here "kriptoanalis" already know the encryption algorithm ciphertext used and that will be read. "Kriptoanalis" can also select the plaintext would be cipherteks encrypted with spouse raised with a particular secret key.

Conditions that ensure security algorithms

There are 3 conditions that, when fulfilled by the algorithm cryptography, it will be able to guarantee security confidential communication made, namely:

1. If the cost to attack or penetrate cryptography algorithms that are used more than the price information will be obtained from results of these attacks. For example, the required computer system is worth 1 billion to penetrate algorithm that is used to protect information is worth 500 million.

2. When the time needed to penetrate algorithm is longer than the validation who wish to obtain information. For example, the time to penetrate a credit card is 1 years, whereas before the 1 year credit card is no longer valid.

3. When cipherteks produced by a cryptography algorithm less than cipherteks required to penetrate algorithm it. For example, of 1000 bits is required cipherteks to hit the key that is used on an algorithm, while the data resulting from the size of the encryption process is less of 1000 bits.

Example of El Gamal Criptography in Number



















Picture above is an example of numerical calculation analogy ElGamal. Clark Kent was originally the public key (y), after he chose a private key is (x). Count y can be read in addition chaining post in this blog. after that Clark tells Lex Luthor key public.

Lex Luthor will send a character 'A' to Clark. Knowing Clark's public key and private key without knowing the property of Clark, he calculates chiperteks (a, b). ASCII characters with a code and b is sent to Clark. Clark chiperteks receive it. ago he was doing decryption by using a and b. plainteks that is' A ', the same as you want to send Lex Luthor

Wednesday, July 29, 2009

algorithm ElGamal public key cryptography

P { margin-bottom: 0.08in } -Our lives at this time influenced by cryptography. From transactions in the ATM machine, hold a conversation via telephone, Internet access, until the missile control using cryptography. Once the importance of cryptography for security information (Information Security), so that when talking about security problems associated with the use of computer, so can not be separated from the cryptography.

One of the algorithms used for encryption and discussed in this article are ElGamal algorithm. This algorithm emphasizes the problems mathematics algorithms. Problems with the ElGamal encryption chipertext results will be very difficult in kriptanalis.

The problems raised in this article are:

  1. How to generate random numbers (prime and not prime) to be the key cryptography in the system?
  2. How to publish public key and private key to hide?
  3. How do I calculate a exponent operation that produces an integer that is very large so that can not be saved by any type of data in a resource program (JAVA)?
  4. How do I calculate the modulo operation of an integer is very large?
  5. How do I calculate the inversion modulo operation of an integer is very large?
  6. How to plain text character conversion chiper text or otherwise using the ASCII table, where the maximum number of ASCII characters must be a prime?
Problems in discrite Algorithm El Gamal is: if p is a prime and g and y is any integer. Find x so that g ^ x ≡ y (mod p). Scale used in the El Gamal is:
1. The prime p (not secret)
2. Random number, g (g

Elgamal algorithm algorithm is one of the public-key cryptography is created by Taher ElGamal in 1984. In the algorithm is generally used for digital signatures, but then modified so that it can also be used for encryption and description.

Encryption process is as follows:

  • Encryption
  1. Plainteks organized into blocks of m1, m2, ..., so that each block represents the value in the range 0 to p - 1.
  2. Select a random number k, which in this case 0
  3. Each block is encrypted with the formula m
  4. a = g^k mod p (1)
  5. b = y^km mod p (2)
  6. Pair a and b are cipherteks to block the message m. Thus, the size ciphertext twice its size plainteks.
  • Decryption
  1. For a and b mendekripsi use a secret key, x, and m plainteks be back with the equality
    m = b / a^x mod p (3)
    mathematics from the equation above can be plainteks that can be returned with the pair a and b
Making a System
Here is a flowchart used in Agoritma ElGamal:

The first prime number p randomly resurrected. Numbers p Range data is used as a reference for plainteks and chiper text. Eg reference to the ASCII code 0 - 256 then the p value is 257.
After that raised random value g and x. X is the value of private key can be raised up so the user wishes and do not have to be random. Terms of generation g and the value of x is:




After the countdown y (public key) to call a function to calculate the y value of the shipment paremeter g, x, and p. After we made the key y g, y, p as a public key and private key as x.

After determining the key encryption process is complete then the message begins with a special encryption function call with parameter m post plain text and key - public key.

After the encryption then email is sent to the destination email. Chiper text size 2X plain text. Once the recipient receives the email in the text chiper decryption with the decryption function with parameters that are sent chiper text. The process of decryption will be done by using the private key of the recipient email (x).

Operation in the a and y is the same value pangkatnya just different. In the a, g dipangkatkan with k while the y, g dipangkatkan with x.

Encryption algorithm from the above looks simple. However, there are complex issues that matter for inclusion in the program code. This is because the algorithm ElGamal operation perpangkatan and modulo the number that large. For example eg in the y and a:
If p = 223 g = 13 x = 131 and k = 127



Above problems can be overcome with the addition of the concept of chaining or divide and conquer

Decryption
Decryption formula is as follows:

formula derived above need to be counted as regular as if it will result in a decimal value. In fact the value in the ASCII table is always integer. So 1 / (a^x) will be downgraded to


Results obtained in decryption is the same value of mj mj with a value that is sent before encryption

the sender does not need to know the private key of the goal. Simply use the public key issued by the Email recipient. With the mathematics diskrit Chipper results obtained a text which does not contain any information on if taken by the man in the middle. That can perform decryption of the text Chipper only party that has a private key or know the purpose of email.










Calendar