jueves, 13 de septiembre de 2012

RSA Algorithm




hello, the task was to make an implementation of the RSA algorithm with sockets

in this case I put the numbers already fixed but the ideal is that the prime number p, q are randomly generated.

i put :

p=61
q=53

and this is the source code of the server:

the source code of the client:

Server Running:



 screenshots client:






references:
http://es.wikipedia.org/wiki/RSA

miércoles, 5 de septiembre de 2012

Diffie Hellman

Hi, In the last class, the homework was about Diffie Hellman.


The Diffie-Hellman allows two parties, communicating through an unencrypted channel, to agree to a numeric value without a third party who has full access to the conversation, to know or calculate it, at least convenient time.

then the values that i ​​got by Alice and Bob were the following:
p = 5
g = 3
X = 4
Y = 2


then i calculate the values of x,y and k:




and the results I got were:
x=2
y=3
k=4






miércoles, 29 de agosto de 2012

Frecuency Monobit Test




hi , in this second week we had to test whether the keys we generated in our one time pad, were really random.

And to see if you really are random generated keys, I did Monobit Frequency by Test.

and formulas necessary for this test are:

sobs = | S | / √ n

where:
n = Length of the bit string.
s = X1 + X2 + ... + Xn, where Xi = 2εi - 1 (conversion to ± 1)

P-value = erfc (sobs / √ 2)

And just if P-value> = 0.01 then you could say it is random otherwise is not random.


source code:

some screenshots:


Any comments or suggestions make me know!!

references:
http://teal.gmu.edu/courses/ECE746/project/slides_2008/RNG_Tests_slides.pdf
http://www.fi.muni.cz/ ~ xkrhovj/lectures/2005_PA168_Statistical_Testing_slides.pdf