Search This Blog

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



Monday, February 1, 2010

Example of the Correlation Listing Program

This is an example of a simulation program to find the verse from the Koran that had problems in user input.simulation program of this correlation calculation using the assumption that the problem user input and verse in the Koran is the extracted with other text mining method (steming, parsing, tagging).

if you have questions you can write the following comment in this blog . to dwonload this file project (Indonesian Ver) click here


/ **
*
* @ Author M Syaiful Rizal
* /
public class correlation (

public static String problem [] [] = (( "adultery", "2 "},{" women", "1"));
public static String paragraph [] [] = (( "17:32", "adultery", "2", "close", "1", "cruel", "1", "path", "1", " bad "," 1 "},{" 24:2 "," adultery "," 2 "," female "," 1 "," stripes "," 1 "," law "," 1 "),
( "5:54", "apostate", "2", "religion", "1", "the", "1"));

public static String Qur'an [] [] = (( "17:32", "and do not approach adultery adultery is actually an act of evil and a bad path"),
( "24:2", "woman taken in adultery and men who commit adultery then each one deralah each of the two hundred and control stripes"),
( "5:54", "O people who believe whoever among you who apostate from the religion so Allah will bring a people that God loves them"));
private static int pnjiterasi;
static double numerator [], the denominator [], xbar [], ybar [], pmbl, korel [];
private static int x, y;
public static void main (String [] args) (
/ / TODO code application logic here
pnjiterasi = problem.length;
xbar = new double [problem.length];
for (int i = 0; i xbar [i] = hitungxbar (i);
onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'" >)


ayat[][] = {{"17:32","zina","2","dekat","1","keji","1","jalan","1","" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">paragraph
.length];
for (int i = 0; i
paragraph.length; i + +) (
ybar [i] = hitungybar (i);
)

numerator = new double [
paragraph.length];
for (int i = 0; i <
paragraph.length; i + +) (
numerator [i] = numeratorcalculate (i);
)

denominator = new double [ayat.length];
for (int i = 0; i <
paragraph.length; i + +) (
denominator [i] = denomeratorcalculate (i);
)
korel = new double [
paragraph.length];

for (int i = 0; i <
paragraph.length; i + +) (
if (denominator [i] == 0.0)
continue;
else
korel [i] = (numerator [i] / denominator [i]);

System.out.println ( "correlation verse to" + i + "is" + korel [i]);
=(0))&&(korel[i]<=1.0)){" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">if ((korel [i]> = (0 ))&&( korel [i] <= 1.0)) ( System.out.println (Qur'an [i] [0] + "" + Qur'an [i] [1]);
)

)

)

private static double numeratorcalculate (int i) (


/ / Calculate the numerator verse to i
/ / Calculate the value of y
tempY int [] = new int [problems.length];
for (int f = 0; f for (int g = 0; g if (problems [f] [0]. equals (sub [i] [g])) (
tempY [f] = Integer.parseInt (sub [i] [g +1]);
/ / System.out.println ( "y for the verse to" + i + "problem to" + f + "is" + tempY [f]);
)
)
)

/ / Calculate the numerator
double tempi = 0.0;
for (int f = 0; f tempi = tempi + ((Integer.parseInt (problems [f] [1])-xbar [f]) * (tempY [f]-ybar [i]));
)
/ / pmbl = tempi;
System.out.println ( "numerator verse to" + i + "is" + tempi);
return tempi;
)

private static double denumratorcalculate (int i) (
double pnyb = 0.0;
/ / calculate the denominator verse to i
/ / it to calculate the total (x-xbar) ^ 2
Double Load imgs = 0.0;
for (int f = 0; f double stack = (Integer.parseInt (problems [f] [1])-xbar [f]);
Load imgs = Load imgs + Math.pow (stack, 2);
)

/ / Number of Y
tempY int [] = new int [problem.length];
for (int f = 0; f for (int g = 0; g if (problems [f] [0]. equals (sub [i] [g])) (
tempY [f] = Integer.parseInt (sub [i] [g +1]);
/ / System.out.println ( "y for the verse to" + i + "problem to" + f + "is" + tempY [f]);
)
)
)

/ / it to calculate the total (y-ybar) ^ 2
double temp = 0.0;
for (int f = 0; f tempY double stack = [f] - ybar [i];
temp = temp + Math.pow (stack, 2);
)

pnyb = Math.sqrt (Load imgs * temp);
System.out.println ( "denominator verse to" + i + "is" + pnyb);
return pnyb;
)

private static double hitungxbar (int k) (
/ / calculate the total x
double temp = 0;
for (int i = 0; i (
temp = temp + Integer.parseInt (problems [i] [1]);
)

double result = Integer.parseInt (problems [k] [1]) / temp;
System.out.println ( "x bar is" + result);
return result;
)

private static double hitungybar (int i) (

/ / Y bar in the clause to the i
/ / calculate the total y
double temp = 0;





Sunday, January 31, 2010

PRIVACY POLICY

Privacy Policy for http://embek-poenya-selera.blogspot.com/


If you require any more information or have any questions about our privacy policy, please feel free to contact us by email at mohammadsyaiful.rizal@gmail.com.


At http://embek-poenya-selera.blogspot.com/, the privacy of our visitors is of extreme importance to us. This privacy policy document outlines the types of personal information is received and collected by http://embek-poenya-selera.blogspot.com/ and how it is used.


Log Files
Like many other Web sites, http://embek-poenya-selera.blogspot.com/ makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user’s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.


Cookies and Web Beacons
http://embek-poenya-selera.blogspot.com/ does use cookies to store information about visitors preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors browser type or other information that the visitor sends via their browser.


DoubleClick DART Cookie


.:: Google, as a third party vendor, uses cookies to serve ads on http://embek-poenya-selera.blogspot.com/.

.:: Google's use of the DART cookie enables it to serve ads to your users based on their visit to http://embek-poenya-selera.blogspot.com/ and other sites on the Internet.

.:: Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - http://www.google.com/privacy_ads.html


Some of our advertising partners may use cookies and web beacons on our site. Our advertising partners include .......
Google Adsense











These third-party ad servers or ad networks use technology to the advertisements and links that appear on http://embek-poenya-selera.blogspot.com/ send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.


http://embek-poenya-selera.blogspot.com/ has no access to or control over these cookies that are used by third-party advertisers.


You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. http://embek-poenya-selera.blogspot.com/'s privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.


If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites.

Friday, January 15, 2010

Correlation Method

To find a link between problems with the verses of Al - Quran then used the correlation method. This method uses mathematical calculations to produce a number that indicates the link between the problem and verses of the Qur'an verses. Correlation formula is :


Where x and y is the average sample mean (array1) and average (array2).

Restore the correlation coefficient of the array1 and array2 cell ranges. Use the correlation coefficient to determine the relationship between the two properties. For example, you can examine the relationship between the average temperature of the location and use of AC.

If an array or reference argument contains text, logical values, or empty cells, those values are ignored, but cells with zero values will be included return CORREL # N / A.

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, October 6, 2009

I Love U (To MY CinderElla)

I love you

like the night loves day
like the dark miss the light
like sand to the water
like nails continue to grow
although always you cut

I love you
sincerely candle on fire
a valley on the mountain would
as calm as a lake in the sky
missed a star on the day
of the heart that you hold
because no registration for the universe
heart that can be as high as you reach
sky-high because no
deep heart can you dive
not as deep as the ocean

I love you
as arrows pointing in my face

pain will rip my pride

to read my Love Story this

Calendar