Search This Blog

Showing posts with label cryptography. Show all posts
Showing posts with label cryptography. Show all posts

Saturday, February 6, 2010

Mail Client With ElGamal Cryptography


System architecture of the program Mail Client with ElGamal cryptography is :





From the picture above can be seen that the mail client sender encrypts the message by sending a plain text parameter of the encryption function. After that sends cipher text encryption function as a result of encryption. With the SMTP port and the cipher text of the message sent to the Mail Server. Mail Server Mail Server sends to the destination if the recipient has a different Mail Server. With POP3 or Imap protocol then the message recipient mail client can receive email. Email recipients can decrypt the cipher text sent parameters. Decryption function will check first private key. After the enter key then the private decryption function can send plain text decryption results. The essence of the above programs are Mail client can send an email to the mail server after encryption. And the recipient mail client can download email delivery at Mail Server, and then decrypt.

the process is :

  1. 1) The process triggers the generation of these numbers is a process to generate random prime numbers as a trigger for ElGamal key lock so that adds to the complexity in its calculations. The more complicated the calculation will be more secure algorithm.
  2. 2) Power private key (x) is the process to calculate the number x of keywords (in a phrase or sentence) that users input. With this process the X does not come out of the range specified in ElGamal.
  3. 3) Generation of public key (y) this process is to calculate the public key (y) by using the private key (x). Y goal is the key to be distributed to the public, so that others can encrypted messages to be sent to us. And we can decrypt the message with the key x (private).
  4. 4) Encrypt the message that the process used to encrypt the plain text or email message early. ElGamal method then this process will produce cipher text (password) with 2 characters represent the plain text characters 1. So the cipher text twice the amount of plain text.
  5. 5) Send the message this process is the process of sending a message to the Java mail to Email Server. This process uses the SMTP protocol to send email. Messages sent in the form of byte [] so that the sending process can go smoothly and be accepted by the Mail Server.
  6. 6) Reading emails this process is the process for reading emails sent. Initially Email Client to download messages to the Mail Server using the POP3 or Imap protocol. Users can choose one of these 2 protocols. After downloading the message is displayed in the table in java mail messages.
  7. 7) Decryption email messages in your email Server is not in decryption. Always in a cipher text. So to read email decryption process carried out beforehand. This process checks first private key. Then decryption process can be done with the same result as the plain text before encryption by the sender in the email.
to download the example Java program click here

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



Sunday, October 18, 2009

The Security of EL GAMAL

some people ask me, it is posibble to break EL Gamal Cryptosytem...i said, that everything is posibble in the Computer World...But to break El Gamal it have a long way and a long time... El Gamal Security have a discrete problem. but i have some tips how to analyze the El gamal Strength... this way not to break and use to crime..but to give us some known, to make our El Gamal Criptosystem better strength....

 ElGamal is very secure. The only ways to break it are by finding collisions in the hash functions it uses, or (in theory) by computing the secret key when two ciphertext messages are sent with the same function of the secret exponent. See Wikipedia for more details

You can do what I do when using safe (p=2p'+1) prime moduli, which is to 
convert the plaintext to all QR's so semantic security is preserved - 
although this is in effect working in the subgroup of QR's of order p', 
which is presumed DDH-hard. 



Which is just a feeble excuse :) to present this method of ensuring all the 
bits are QR's, and the overall scheme is IND-CPA. I don't know who else 
invented the method first, but I haven't seen it elsewhere: 


[- 

Chose p' so p' = 1 mod 4. Thus p = 3 mod 8, and (2/p) = -1 (ie 2 is a QNR 
mod p). 

Before encryption prepend the bits 001 to the plaintext, test for QR: if it 
is QR then pass on to the encrypter, if it is NQR then shift left (multiply 
by two) before passing it on. 

2 is NQR, and any NQR x any NQR = a QR - so all the blocks sent to the 
encrypter are QRs. 

After decryption, shift right if the second bit of the block is set. Discard 
the first 3 bits.

Tuesday, September 15, 2009

ECC Cryptography

elliptic curves cryptosystem or shortened by the ECC, is one of the asymmetric cryptographic system that uses the discrete logarithm problem (the discrete logarithm problem). Structure of elliptic curves are used as mathematical operations group to establish a process of encryption and description

In 1985, Neil Koblitz and Victor Miller independently introducing Elliptic Curves Cryptosystem - ECC which uses the discrete logarithm problem at the points elliptic curve called ECDLP (Elliptic Curves Discrete Logarithm Problem). This Criptosystem ellipse curve can be used in any purposes such as:
Scheme encryption (ElGamal ECC)
• Digital Signature (ECDSA - Elliptic Curves Digital Signature)
• key exchange protocol (Diffie Hellman ECC)

Elliptic Curves Cryptosystem using discrete logarithm problem in elliptic curve using elliptic curve groups. Structure of elliptic curves are used as mathematical operations group to establish a process of encryption and description. This method causes difficulties to calculate k given Q and P, where Q = k P.

for example calculate the ECC, awaiting the next blog :)

Sunday, September 13, 2009

History of Cryptography

Cryptography has been used about 40 centuries ago by the people Egypt to send a message to the troops who were on the battlefield and to the message is not readable by the enemy, although the messenger captured by the enemy. Around 400 BC, cryptography was used by the Spartans in the form of a piece of papyrus or parchment covered with a wooden rod. In ancient Roman times, when Julius Caesar wanted to send a message secret to a general on the battlefield. Such messages should be sent by a soldier, but because it contains a secret message, Julius Caesar did not want to open the message in the middle of the road. Here Julius Caesar thinking about how to handle it is to randomize the contents of the message into a message that can not be understood by anyone but can only be Generals understood by all. Of the General had been notified earlier how to read the random messages, having learned key. In the second world war, German enigma machine or also called the rotor machine used by Hitler to send a message to troops on the battlefield. Germans really believe that the message is encrypted use can not be solved enigma.
But the assumption was wrong, after years of study and the allies had cracked the codes it. After the Germans know that the enigma can be solved, then the enigma has experienced several changes. German Enigma used to encrypt a message that has the possibility to be able 15'1018
decrypt the message. some historians believe that the end of World War II due to the Enigma encryption techniques solved.
The development of computer and communication systems in the 60's impact on the demand of certain parties as a means to protect information in digital form and to provide services security. Starting from Feistel of IBM's business in the early 70s and achieving
\ peak in 1977 with the appointment of DES (Data Encryption Standard) as a federal information processing standards of the United States to encrypt information that is not yet classified. DES is a cryptographic mechanism The most known throughout history. The most surprising development in the history of cryptography occurred in 1976 when Diffiel and Hellman published "New Directions in Cryptography". This paper introduces the revolutionary concept of public key cryptography, and also provides a new method for key exchange, security is based on
power discrete logarithm problem. although, Diffiel and Hellman not have practical realization of the idea of public key encryption that time, the idea is very clear and foster a broad interest in the cryptographic community. In 1978 Riv est, Shamir and Adleman discovered the design of public key encryption is now called RSA. Draft RSA factoring problem, based on hard numbers,
and reactivate efforts to find a more efficient method for factoring. 80 years of vast increases in these areas, the RSA system is still safe. Another system is the design of public key found by Taher ElGamal in 1985. This design based on discrete logarithm problem. One of the important contribution of public-key cryptography is a sign digital signatures. In 1991 the first international standard for digital signatures adopted. This standard is based on RSA public key design. In 1994 United States government adopted the Digital Signature Standard, a cryptographic mechanisms based on the ElGamal algorithm.

Crypto Graphia

Cryptography (cryptography) comes from the Greek, composed of two tribes word of "crypto" and "Graphia". "Crypto" means hidden, while "Graphia" means writing. Cryptography is the study of mathematical techniques related to information security aspects, such as data confidentiality, validity of data, data integrity, and authentication data (Menezes, Oorschot and
Van stone, 1996). But not all aspects of information security can be resolved with cryptography. Cryptography can also be defined as the science or art to message security guard. When a message is sent from one place to others, the content of these messages may be intercepted by other parties who are not entitled to know the contents of the message. To keep the message, the message can be converted into a code that can not be understood by other parties.
Encryption is an encryption process to change a codes (messages) from which can be understood (plaintext) into a code that is not understandable (ciphertext). Whereas the reverse process to convert ciphertext be called plaintext decryption. The process of encryption and decryption mechanisms and require a certain key. Cryptanalysis (cryptanalysis) is the opposite of cryptography, which is a science to solve the cryptographic mechanisms in a way to get the key from ciphertext used to get plaintext. Cryptology (cryptology) is a science that includes cryptography and cryptanalysis.
There are four fundamental goals of cryptography is also an aspect security of information, namely
  1. 1. Confidentiality, are aspects related to the maintenance of information content from anyone except those with authority or a secret key to open the encrypted information.
  2. 2. Data integrity, are aspects related to the preservation of the data changes illegally. To maintain the integrity of data, the system must have the ability to detect data manipulation by the parties is not entitled, such as insertion, deletion, and substitutedother data into actual data.
  3. 3. Authentication, are aspects related to identification or recognition, both for inclusion and the information system itself. Two parties communicate with each other to introduce themselves to each other. The information submitted must be authenticated authenticity, data content, time delivery, and others.
  4. 4. Non-repudiation (denial rejected), is an attempt to prevent the denial by sending a sending information, or should be able to prove that a message from someone, when he denied sending such information. (Menezes, Oorschot and Vanstone, 1996).

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

The Caesar's Cryptography

Caesar substitution:
Cryptography has been known since Roman times. Was a great king of the Romans at that time whose name was Julius Caesar who introduced the first cryptographic techniques. He used it to hide a secret letter he would send. If the couriers were arrested and the letter fell into the hands of the enemy then the Mush still can not get any information even managed to get a physical letter. Caesar cryptography technique is actually simple, namely by replacing each letter with another letter in the alphabet with the previous agreement. So Cesar and the recipients have made an agreement with a table - tables alphabetically between the original letter by letter instead. Here is an example of cryptographic Caesar.

Example, alphabetical table appointments as follows:

If you want to send a C-section the phrase: "WAR" then the contents of the letter is "DZI". While recipients will return to match sentences in the letter in the table and translated back so he could read the same sentence with what is going to be sent Caesar. While others who do not have the above table can not be read, so that security letter awake. It was said that Caesar's love letter to Cleopatra also uses cryptography so that it can not be known by the senate - the Roman senate who did not like his relationship with Cleopatra.

Cryptography techniques above Caesar substitution technique is also called a cesarean (Substitution Caesar) or substitution techniques. Cryptographic system is to survive long enough, but eventually can be solved. The simplicity of the encoding techniques into the basic technique of substitution is weakness. Enough with the technique Brute Force Attack, or even with just the trial error cryptographic encryption can be solved. By simply knowing what the letters out and then a lot of analysis. For example in the Indonesian language the letter 'A' appears at most, so if the letter is the letter 'Z' appears at most, it can be concluded that the letter 'Z' is a substitute letter 'A'. Once on the next to get a clear information.

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.

About Taher El Gamal (wikipedia)


Dr. Taher Elgamal

(born 18 August 1955) is an Egyptian cryptographer. Elgamal is sometimes written as El Gamal or ElGamal, but Elgamal is now preferred. In 1985, Elgamal published a paper titled A Public key Cryptosystem and A Signature Scheme based on discrete Logarithms in which he proposed the design of the ElGamal discrete log cryptosystem and of the ElGamal signature scheme. The latter scheme became the basis for Digital Signature Algorithm (DSA) adopted by National Institute of Standards and Technology (NIST) as the Digital Signature Standard (DSS). He also participated in the 'SET' credit card payment protocol, plus a number of Internet payment schemes.

Elgamal has gained a Bachelor of Science degree from Cairo University, and Masters and Doctorate degrees in Computer Science from Stanford University. He served as chief scientist at Netscape Communications from 1995 to 1998 where he was a driving force behind SSL. He also was the director of engineering at RSA SecuritySecurify in 1998 and becoming their CEO. When Securify was acquired by Kroll-O'Gara[1], a company providing Independent IT Controls measurement and software verification at the binary level. In October 2006 he joined Tumbleweed Communications [2] in a capacity of a Chief Technology Officer. Tumbleweed was acquired in 2008 by Axway Inc. He is an advisor to Onset Ventures, glenbrook partners, PGP corporation, Arcot Systems, Finjan, Facetime and serves as Chief Security Officer of Axway, Inc. Inc. before founding he became the president of its information security group. In 2008, Securify was acquired by Secure Computing and is now part of McAfee. In addition, Elgamal sits on the board of Vindicia, a company which provides online payment services as well as the Advisory Board of SignaCert, Inc.


Calendar