jueves, 22 de noviembre de 2012

Lab 7

Elegi el problema del libro Sistemas de Control moderno parecido a un problema ya antes hecho. 

Un sistema tiene la función de transferencia

$GH(s)= \frac{20}{s(s+2)(s+3)}$

$GH(s)= \frac{20}{s^{3}+5 s^{2}+ 6s}$

Para este problema se obtendria

a)Si el sistema es estable
b)Las raíces de la ecuación carácterisitca 

Para medir la estabilidad utilice el diagrama de Nyquist la forma más sencilla es obtener los puntos críticos o raíces del denominador de la función del problema.




Para obtener los puntos críticos utilice la ecuación característica en este caso seria la siguiente: 

${s^{3}+5 s^{2}+ 6s}$



Y este es el diagrama de Nyquist como resultado donde observamos si existe o no estabilidad, se puede determinar por la ubicación de los polos(raíces de la ecuación característica) en el plano s. Si alguno de los polos de la ecuación característica se encuentran en el semiplano derecho el sistema es inestable"





Conclusión 
Dentro del diagrama observamos que G tiene los polos rodea hacia el lado izquierdo del semiplano esto como antes mencionamos es porque el sistema se encuentra estable.

martes, 20 de noviembre de 2012

Proyecto final

El reporte del proyecto se encuentra en el blog de mi compañera Blanka
Proyecto. Control de Elevador
Equipo:
Adriana
Rodolfo
Vanessa
Rene
Blanka

martes, 13 de noviembre de 2012

jueves, 1 de noviembre de 2012

Lab 5. Diagrama de Nyquist

Para esta actividad seleccione el problema 8.16 del libro el cual consta de los siguiente: 

Considere un sistema de control con realimentación unitaria con la siguiente función de transferencia en lazo abierto:

$G(s) = \frac{s^{2}+2s+1}{s^{3}+0.2s^{2}+s+1}$

Dibuje un diagrama de Nyquist de $G(s)$ y examine la estabilidad del sistema a lazo cerrado.

Para realizar el diagrama de Nyquist utilizaremos Octave aquí ingresamos lo que son los valores de la función de transferencia para saber si el sistema es estable al mostrarla en el diagrama. 

Código para obtener el diagrama: 






Diagrama: 

Conclusión:
En este diagrama como vemos que G(s) tiene  polos a lazo abierto en el semiplano derecho del plano "s" y el diagrama de Nyquist rodea el punto crítico (-1 + j0) dos veces a la izquierda, el sistema se encuentra estable. 

Caso de estudio: Contraseñas seguras

martes, 30 de octubre de 2012

Programa 1.

En esta entrada haremos diferentes pruebas en la función de transferencia que teníamos anteriormente:
$F(t)= \frac{\frac{Re}{k\Phi }}{T_{m}S}[l_{e}S-l{_{c}(S)}]$

Pruebas: 
Con este código obtuvimos una gráfica en la que no hubo ningún tipo de resultado o alguna perturbación que tuviera estabilidad. 


Aquí hacemos la prueba con algunos valores para saber su estabilidad del sistema, como vemos hubo diferentes cambios en relación al tiempo tiene diferentes variaciones.

octave:1> den = [1 1];
octave:2> num = [20];
octave:3> sys = tf(num,den);
octave:4> bode(sys)
octave:5> step(sys)





miércoles, 24 de octubre de 2012

SEAL-Stream Cipher


A more secure SEAL was designed in 1992 by Rogaway and Coppersmith, speci cally for the purpose of obtaining a software effi cient stream cipher. SEAL is still the fastest steam cipher for software implementations on contemporary PC's, with "C" implementations running at 5 cycle/byte on common PC's (and 3.5 cycle/byte on some RISC workstations).

The design of SEAL shares many similarities with the design of common block ciphers. It is built around a repeating round function, which provides the "cryptographic strength" of the cipher. 

Algorithm optimized for 32-bit processors.
  • Jogging requires eight 32-bit registers and a cache a few kilobytes
  • Through a seemingly slow operation, SEAL preprocesses the operation of keys in a set of tables.
  • Then these tables are used to increase the speed of encryption and description
SEAL is not a traditional flow cryptosystem, this is a pseudo functions family, is a family of functions pseudo - random.

ITS OPERATION
Its operation is based on a initial process in which are calculated values for some tables from the key, so that proper encryption can be carried out in a way really fast. Unfortunately, it is also subject to patent algorithm.
Given a key 160-bit, k and a number n of 32-bit
  • SEAL extends a string of L n k bits (n)
  • L can take any value less than 64 kilobytes
  • Is supposed to SEAL takes advantage of the property of k is selected randomly
  • Then k (n) may be that not distinguished computationally a random function of L 'n' bits
A very useful feature of this algorithm is that it is not based on a linear system of
generation, but that of a family of pseudorandom functions, in such a way that any part of the sequence can be calculated providing only a whole number n of 32-bit. 
With a cryptosystem as SEAL
  • You can access any bits of the generated key
Use:
  •  Make a hard drive
  • Encrypt by and every sectors of 512 bytes
  • With SEAL is possible to encrypt the contents of the sector n, with an XOR of the content with the key k (n).

SEAL is based on the use of the SHA algorithm (see section 13.1.4 on) to generate the tables
that it uses internally. In fact, there are two versions of the algorithm, the 1.0 and 2.0, that differ precisely in that the first employs SHA and the second its on revised version, SHA-1.

Algorithm controlled by three tables derived keys: R, y, S, and T
  • Preprocessing maps the key k, to these values using a procedure based on SHA
Also used four 32-bit registers: A, B, C and D
  • Initial values are determined by n and R and T tables
  • These records are modified through several iterations, each one involves 8 turns iterations, each one involves 8 laps.
  • In each iteration 9 bits of a register are used to index the table T.
  • Content table gives a xor with the contents of a second record A, B, C and D.
  • First record is travel (shifted) 9 positions.
In some iterations the second record is modified amended through an xor with the first now travel record
  • After 8 iterations of this, A, B, C and D are added to the stream of the key
  • The iteration is completed by adding to A and C additional values depending on n n1 n2 additional depending on n, n1, n2, n3 and n4 values.
  • Exactly which depends on the parity of the number of iteration.
Function Seal






Here compares the efficiency of each stream cipher Stream cipher

Referencia:


jueves, 18 de octubre de 2012

Lab 4. Problema 5.11

Considere el sistema de la Figura 5.85 determine el valor de k de modo que el factor de amortiguamiento  $\zeta$ sera 0.5. Después obtenga el tiempo de salida $t_{r}$ , el tiempo pico tp $t_{p}$, la sobreelongacion maxima $M_{p}$ y el tiempo de asentamiento $t_{s}$, en la respuesta escalon unitario.


El valor de "k" obtenido mediante la función de transferencia mostrada en la figura es el siguiente:


$\frac{C(s) }{R(s)}= \frac{16}{s^{2}+(0.8+16k)s+16}$

 $W_{n}= 4$

 $25W_{n} = (2)(0.5)(0.4)= 0.8 + 16k$
Finalmente el valor de "K"
$k = 0.2$
 
Valores de $W_{d}$ y $\beta$
$W_{d}= W_{n}\sqrt{1-5^{2}}= 4\sqrt{1-0.25}= 3.46$

$\beta = sin^{-1}\frac{W_{d}}{W_{n}}= sin^{-1}(0.866)= \frac{\Pi }{3}$

Obteniendo los valores del tiempo de salida  $t_{r}$
$t_{r}=\frac{\Pi -\beta }{W_{d}}$ $t_{r}=\frac{\Pi -1/3\Pi }{3.46}= 0.605 seg$

Tiempo pico del sistema se obtiene de la siguiente manera:
$t_{p}=\frac{\Pi }{W_{d}}=\frac{3.1416}{3.46}=0.907 seg$

Para sacar la sobreelongación máxima $M_{p}$ utilizaremos la siguiente formula:

$M_{p}= e^{-\frac{\zeta \Pi }{\sqrt{1-\zeta ^{2}}}}$
$M_{p}= e ^{-\frac{(0.5)(3.1416) }{\sqrt{1-(0.25)}}}$
$M_{p}= e ^{-1.314}=0.163$

Por ultimo para sacar el tiempo de asentamiento utilizamos la siguiente formula con el valor de $W_{n}$ obtenido anteriormente
$t_{s}=\frac{4}{\zeta W_{n}}= \frac{4}{(0.5)(4)}= 2 seg$










 
 
 
 
 




miércoles, 17 de octubre de 2012

3-Way Block cipher

For this week we need chose a block cipher.  I chose the 3-Way block cipher this is the explain.
 
Origins
In cryptography, 3-Way is a block cipher designed in 1994 by Joan Daemen. One of such block cipher algorithm is the 3-Way Algorithm and has a key and block size of 96 bits.
The 3-Way algorithm is an iterated block cipher that repeats some relatively simple operations a specified number of times.
 
Has the following characteristics:
Merits of 3-Way Algorithm
  • 3-Way algorithm is efficient in wide range of platforms from 8-bit processors to specialized hardware.
  • 3-Way algorithm resembles more mathematical features which enable all the decryption to be done in exactly same way as in encryption.
  • 3-Way encryption ensures total security in on-line transactions.
  • This algorithm provides additional security to protect customers order information such as credit card numbers.

DeMerits of 3-Way Algorithm

  • 3-Way algorithm requires a lot of space for its execution.
  • Resynchronization is one of the main problems in 3-way algorithm.

Applications of 3-Way Algorithm

  • 3-Way algorithms are used in web browsing, electronic mail, internet faxing, instant messaging and voice-over-IP.
  • 3-Way algorithm has prominent role in establishing network over wide ranges.
  • They are used in many web applications.
  • 3-Way algorithm provides more security when compared to any other algorithms.

Steps Involved in 3-Way Encryption

  • Information is coded between the customer and our server.
  • An e-mail is sent to merchant (the information where it is to be transmitted) notifying the order, when the Information is coded on our own hard drive.
  • At last when the merchant retrieves the order, the third coding takes place.

Steps Involved in 3-Way Decryption

  • The server must use a RSA key exchange mechanism.
  • RSA key mechanism can be replaced by Diffie-Hellman key exchange mechanism also.
  • We must have access to server’s private RSA key and be able to be coped to the required destination.
  • Outputting a fake 3-way TCP handshake is possible for the decrypted traffic. Thus by keeping the TCP sequence numbers up to date, decrypted server satisfies all the client requests.
Structure:
A related key attack on 3-way requires one related key query and 2 22 chosen plaintexts. It is closely related to BaseKing; indeed, the two are variants of the same general cipher technique.

Type of mathematics that is based on this algorithm
  • 3-Way is an 11-round substitution-permutation network.
  • 3-Way is designed to be very efficient in a wide range of platforms from 8-bit processors to specialized hardware, and has some elegant mathematical features which enable nearly all the decryption to be done in exactly the same circuits as did the encryption.
Implement
One way to implement decipherment with 3-Way is to implement it as encipherment with a modified key schedule, preceded and followed by a step reversing the order of all the bits in the 96-bit block; this is the scheme shown in the C code given in Bruce Schneier's famed book Applied Cryptography.



As can be seen from the diagram, a round consists of a number of distinct steps.

1st step: Is the XOR of key material with a round constant.

The round constants for the eleven rounds, and the final additional key XOR operation,
of 3-Way are:
 1) 0000 1011 0000 1011     0B0B
 2) 0001 0110 0001 0110     1616
 3) 0010 1100 0010 1100     2C2C
 4) 0101 1000 0101 1000     5858
 5) 1011 0000 1011 0000     B0B0
 6) 0111 0001 0111 0001     7171
 7) 1110 0010 1110 0010     E2E2
 8) 1101 0101 1101 0101     D5D5
 9) 1011 1011 1011 1011     BBBB
10) 0110 0111 0110 0111     6767
11) 1100 1110 1100 1110     CECE
12) 1000 1101 1000 1101     8D8D


So the symmetry does not break down, but the period is not maximal.

2nd step: Called theta, is a matrix multiplication using XORs; it is indeed a matrix multiplication, modulo 2, carried out in parallel eight times, for each of the eight bits each of the twelve bytes in the block contains.
The matrix multiplication involves the matrix: 
The matrix multiplication has a structure that allows it to be implemented in terms of shifts and XORs of 32-bit words.

3rd step, pi-1, now provides diffusion between the bits of the bytes by performing two different rotations on two of the 32-bit subblocks of the 96-bit block. In this step, the first 32-bit subblock is rotated 10 bits to the right, and the third 32-bit subblock is rotated 1 bit to the left. The second subblock is not modified.

4th step: Gamma, applies a nonlinear S-box with three inputs and three outputs to corresponding bits of the three subblocks.
Each bit is XORed with the OR of the next bit and the inverse of the bit after that, leading to an S-box with the table:
 
5th step: pi-2, provides diffusion between bits, as well as maintaining the symmetry that relates decipherment to encipherment. Here, it is the first 32-bit subblock that is rotated 1 bit to the left, and the third 32-bit subblock that is rotated 10 bits to the right.

Decipherment
The theta and gamma operations both become their own inverses when the 96 bits of the block are handled in reverse order, and pi-2 with bits reversed becomes the inverse of the original pi-1, and so on.

To invert a cipher, one has to perform the inverses of each of the steps in reverse order. The fact that the XOR of the key precedes the theta step is the only complication; in addition to being used in reverse order, and with bits reversed, the key for each round must go through the theta step. 

Attacks and vulnerabilities
3-Way is vulnerable to related-key attacks, and therefore it should only be used with keys that are generated by a strong RNG, or by a source of bits
that are sufficiently uncorrelated (such as the output of a hash function).
http://www.slideshare.net/rajeevrvis/3way

http://www.cosic.esat.kuleuven.be/publications/article-141.pdf

martes, 9 de octubre de 2012

Reporte 2. Diagrama de Bloques

A partir de un modelo matematico del sistema, podemos determinar una función matematica que ligue a las variables de entrada y las de salida, a esto lo podemos llamar función de transferencia.

Este diagrama de bloques representa la función de transferencia del motor que actuara en el sistema.
Se tomara como variable de entrada al voltaje aplicado definido como y como variable de salida a la velocidad de rotación.

$Ve(t)$

$\Omega (t)$

$\Omega (s) =\frac{ \frac{Re}{k\Theta }}{Tms} [le(S)-lc(S))]$

Se realiza una reducción de ecuaciones mediante el reemplazo de equivalencias, hasta obtener una unica ecuación que intervendra en el sistema.

Diagrama de Bloques:

A partir de la ecuación unica iniciamos la construcción del diagrama.






Bibliografía:
Sistemas de Control
Diagrama de Bloques

jueves, 20 de septiembre de 2012

RSA-Firmas Digitales

For this homework I need to implement a HTTP public-key repository for key exchange that employs RSA-Based digital signatures,  I used PHP and a little database in mysql also a little script in Python.

This is the PHP+MySQL code



This is the script in python



This is the authentication with the web service, here is the validation 


martes, 18 de septiembre de 2012

Entrega 3.

Para esta entrega seleccione el ejercicio B.3.15 el cual consiste en:
Obtener una representación en el espacio de estados del sistema mecánico de la figura 3.80,
donde u1 y u2 son entradas e y1 e y2 son salidas.


Representación en el espacio de estados:

La representación de un sistema en espacio de estados permite relacionar las variables de entrada u(t) y de salida y(t) mediante una ecuación diferencial matricial de primer orden (Ecuación de Estado) y una combinación lineal de la entrada y los estados x(t) (Ecuación de Salida) de la forma:

Ecuación de Estado:
$\frac{dx(t)}{dt}= Ax(t)+Bu(t)$
Ecuación de salida:
 $y(t)=Cx(t)+Du(t)$
La teoría que representa los sistemas mecánicos es la Segunda Ley de Newton, donde tenemos las sumatoria de fuerzas que intervienen en el sistema.

$\sum Fext=ma$

Las variables de estado que intervienen en el comportamiento del sistema son las siguientes:
$u_{1}$ y $u_{2}$ = fuerzas aplicadas y son las entradas del sistema
En el sistema se muestran 2 fuerzas aplicadas estas son a las 2 masas que intervienen en el sistema $m_{1}$ y $m_{2}$

$k_{1}$ y $k_{2}$ representa la constante de elastica.
b es la constante de biscosidad
$y_{1}$ y $y_{2}$ son las salidas del sistema.

Tomando en cuenta las ecuaciones anteriores pasamos a la solución del problema

1. Esta es la ecuación de la sumatoria de las fuerzas para las dos masas representadas en el sistema.
 $m_{1}\ddot{y_{1}}+ b_{1}(\dot{y_{_{1}}})-\dot{y_{2}}+k_{1}y_{1}=u_{1}$

$m_{1}\ddot{y_{1}}+ b_{1}(\dot{y_{_{1}}})-\dot{y_{2}}+k_{1}y_{1}=u_{1}$

2. Variables de desplazamiento
$x_{1}= y_{1}$
$x_{2}= \dot{y_{1}}$
$x_{3}= y_{2}$
$x_{4}= \dot{y_{2}}$

3.Aquí obtenemos las ecuaciones diferenciales para encontrar las salidas del sistema
$m_{1}\dot{x_{2}}+b_{1}(x_{2}-x_{4})+k_{1}x_{1}=u_{1}$
$m_{2}\dot{x_{4}}+b_{1}(x_{4}-x_{2})+k_{2}x_{3}=u_{2}$

4. Obteniendo la representación de las salidas o ecuación final del sistema
$\dot{x_{1}}=x_{2}$

$\dot{x}_{2}= -1/m_{1}[b_{1}(x_{2}- x_{4})+k_{1}x_{1}]+ (1/m_{1})u_{1}$

$\dot{x_{3}}=x_{4}$

Representación en el espacio de los estados dentro del sistema. 
$\dot{x}_{4}= -1/m_{2}[b_{1}(x_{4}- x_{2})+k_{2}x_{3}]+ (1/m_{2})u_{2}$



jueves, 13 de septiembre de 2012

RSA Authentication

For this week, we had to do the following:
  •  Implement RSA authentication in Python for a client-server system with sockets.

Key generation
RSA involves a public key and a private key. The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. 

So, the algorithm is:

    * Generate n = p × q, where both p and q are prime.
    * (e, n) is the public key; c = m^e mod n.
    * e is to be relatively prime with ɸ(n)
    * (d, n) is the private key; m = c^d mod n.
          o Requirement: e × d ≣ 1 mod ɸ(n) (or in other words d needs to be the inverse multiplicative of e);
    * ɸ(n) = (p - 1) × (q - 1).
    * m^(e×d)≣ m mod n due to Euler’s theorem.

 
These are the results.


Code RSAKeys: 






Server:



Cliente: 
 Here I have a difficult with of server, this is the code but it hasn´function

domingo, 9 de septiembre de 2012

Reporte 1(Clase). Modelo matemático

Estaremos trabajando con un estacionamiento giratorio, el sistema es mecánico giratorio, en este caso trataremos el movimiento del motor, dentro de este intervienen factores de entrada y salida para realizar el movimiento.

Para que la rueda haga su funcionamiento, interviene lo que es una señal de impulso esta sera emitida por el arduino, la rueda realizara un desplazamiento  al aplicar una fuerza considerando el peso de la rueda y de la cantidad de autos. 


Entrada:
Para poder realizar el movimiento de la rueda y del motor, se consideraría la 2 fuerzas aplicando la segunda Ley de Newton


Estas formadas por las masas de los objetos que serian los autos y el peso de la rueda en sí que serán aplicadas al motor.
$Ft=m(r\alpha )$
$Fr=ma_{r}=m(\omega ^{2}r)$

Salida:
Dentro del sistema existe un movimiento rotacional, una extensión de la Ley de Newton para este tipo de movimiento indica que: 
“La suma algebraica de los momentos o pares alrededor de un eje fijo es igual al producto de la inercia por la aceleración angular alrededor de dicho eje” 
  • ω = velocidad angular
  • ∝ = aceleración angular
  • θ = posición angular 
 Considerando la velocidad angular existe el desplazamiento que realizara el motor. 
 

jueves, 6 de septiembre de 2012

Tarea 2. Transformada inversa de Laplace

Para la segunda entra de laboratorio se obtuvieron las fracciones parciales y la transformada inversa de la siguiente función:

$F(s)=\frac{11s^{2}-2s+5}{(s-2)(2s-1)(s+1)}$
Procedimiento:
Este problema lo realice mediante la herramienta Octave, dentro de aquí se utiliza las siguientes variables para obtener los valores necesarios. 
r = Son los residuos (numeradores)
p = Son los polos (denominadores)
k = Es el cociente
e = Son los exponentes para cada denominador

Para resolver en Octave utilizamos un vector donde capturamos los coeficientes de n(numeradores) y d(denominadores).

Después encontraremos los elementos en que se descompone la función:

Con los valores obtenidos tendremos el procedimiento para nuestra Tansformada Inversa de Laplace mediante fracciones Parciales:
$F(s)=\frac{11s^{2}-2s+5}{(s-2)(2s-1)(s+1)}= {\frac{A}{(s-2)}}+{\frac{B}{(2s-1)}}+{\frac{C}{s+1}}$ $[{F(s)=\frac{11s^{2}-2s+5}{(s-2)(2s-1)(s+1)}= {\frac{A}{(s-2)}}+{\frac{B}{(2s-1)}}+{\frac{C}{s+1}}}](s-2)(2s+1)(s+1)$ $11s^{2}-2s+5=A(2s+1)(s+1)+B(s-2)(s+1)+C(s-2)(2s-1)$ $11(-1)^{2}-2(-1)+5=A((2)(-1)-1)(-1+1)+B(-1-2)(-1+1)+C(-1-2)(2(-1)-1)$ $11+2+5=A(-2-1)(0)+B(-3)(0)+C(-3)(-2-1)$ $11+2+5=(0)+(0)+C(-3)(-3)$

Resultado de C:
18=C(9)
9C=18
C=18/9
C=2
Resultado de B:
$11s^{2}-2s+5=A(2s+1)(s+1)+B(s-2)(s+1)+C(s-2)(2s-1)$ $11s^{2}-2s+5=A(2s+1)(s+1)+B(s-2)(s+1)+C(s-2)(2s-1)$ $11(1/2)^{2}-2(1/2)+5=B((1/2)-2)((1/2)+1)$ $11(1/2)^{2}-2(1/2)+5=B((1/2)-(4/2))((1/2)+(2/2))$ $(11/4)-2(1/2)+5=B(-3/2)(3/2)$ $(11/4)-(4/4)+(20/4))=B(-9/4)$ $(11-4+20)/4=B(-9/4)$ $27/4
$=B(-9/4)$ $(27)(4)=B(-9)(4) $(-9)(4)$
$B=(27)(4)$
$B=\frac{(27)(4)}{(-9)(4)}=\frac{27}{-9}$ $B=-3$
 Resultado de A:
$11s^{2}-2s+5=A(2s+1)(s+1)+B(s-2)(s+1)+C(s-2)(2s-1)$ $11(2)^{2}-2(2)+5=A(2(2)-1)(3)$ $44-4+5=A(3)(3)$ $45=A(9)$ $9A=45$ $A=45/9$ $A=5$

Transformada Inversa de Laplace:
$F(s)=\frac{11s^{2}-2s+5}{(s-2)(2s-1)(s+1)}$ $= {\frac{5}{(s-2)}}+{\frac{-3}{(2s-1)}}+{\frac{2}{s+1}}$ $F(s)=\frac{11s^{2}-2s+5}{(s-2)(2s-1)(s+1)}= {\frac{5}{(s-2)}}+{\frac{-1.5}$ ${(s-.05)}}+{\frac{2}{s+1}}$

El resultado es: $F(s)=\frac{11s^{2}-2s+5}{(s-2)(2s-1)(s+1)}$ $=5e^{2t}-1.5e^{.5t}+2e^{-t}$

Third. Diffie-Hellman Protocol

For the third asignament, we worked in group of three, in order to practice the Diffie-Hellsman Protocol, the  members name are Alice, one being Bob, and one Eve, and then changing roles so everyone gets to be Eve one time.

When my turn to be Eve came, Adriana was Alice, and Rodolfo was Bob. They talked in secret generating the values of p and g. Then they made said values, and their respectives X and Y public.:
  • p = 13
  • g = 5
  • X = 12
  • Y =8
With this then I have to start to obtain the values of x and y, and then the key. So I started first with obtaining x from the X function:

To get x, I took a way with every number lower than p and I got this value as seen here.  And this is the procedure that I made.




I just multiplied the current power of 5*5 again, and then divided by 13, to check the residue(module). 
Now, we can try the same with y, as we saw in the previous table, we already got your value which resulted in y = 3 and here to check the value.



And

K = (12^3) % 13 =  12*12*12 % 13 = 12
K =  (8^12) % 13= (8*8*8*8*8*8*8*8*8*8*8*8) % 13 = 12

I concluded that the Key was 12, with x = 6, and y = 3. Adriana and Rodolfo confirmed this.

jueves, 30 de agosto de 2012

Análisis OTP

Para la segunda tarea de esta semana se utilizo One-time Pad nuevamente para hacer un análisis de frecuencias. Utilice como ayuda el blog de mi compañero Emmanuel.

Frecuencia de caracteres

Para esta parte se agrego dentro del programa one-time-Pad para obtener las frecuencias donde solo utilizando caracteres  pertenecientes a los ASCII" aquí muestro como tomar las frecuencias para solo 2 llaves.
 
Los valores que se muestran son las frecuencias con la que aparecen varios caracteres dentro de nuestro mensaje en distintas llaves.

Aquí dejo el comportamiento de estas frecuencias con la que aparecen los caracteres "abcdfghijklmnopqrstuvwxyz,.;:"


Histograma

Existen caracteres que no tienen alguna repetición en este caso aparecio mas de la "a" a la "e". 
Referencia:
Blog
Create Histagram

jueves, 23 de agosto de 2012

Graficas de funciones


Mi problema a resolver es ver el comportamiento de funciones con escalas lineales en "x" y  "y" así como logarítmicas.
Esto lo realice mediante Gnuplot, las escalas que utilice son pequeñas para ver el comportamiento.

Escalas lineales:
Esta referida a una única dimensión, eslora, manga, calado, etc. Por ej.: la escala de 1: 50 se refiere a que una determinada medida de nuestro modelo es 50 veces menor que la de la embarcación original.
Escalas Logarítmicas:
Una escala logarítmica es una escala de medida que utiliza el logaritmo de una cantidad física en lugar de la propia cantidad.
Un ejemplo sencillo de escala logarítmica muestra divisiones igualmente espaciadas en el eje vertical de un gráfico marcadas con 1, 10, 100, 1000, en vez de 1, 2, 3, 4 

Gráfica con escala lineal en x & y: Para esta gráfica utilice el comando xscale  [ 0 : 30 ] para ver el comportamiento de la gráfica.
Se muestra el comportamiento de esta gráfica, su desplazamiento es más hacia la izquierda, la escala que tiene es para que pueda visualizarse como se comporta el gráfico.
Gráfica con escala log en x & lineal en y:



Gráfica con escala log en y & lineal en x:


Gráfica con escala log en x & y:

 

sin x
log x lineal en y
x^2 lineal:

Algunas de las instrucciones que utilice para poder mostrar las graficas con funciones son las siguientes: 
set xrange[ 0.1 : 100 ]: cambia el rango en el eje "x" 
set logscale x: Dibuja usando ejes logaritmicos
plot: muestra la gráfica indicando la función que queremos.
set yrange[ 20 : 50 ]: cambia el rango en el eje "y"

Referencias: 
http://www.firebirds.com.ar/lugcos/deposito/docs/gnuplot/gnuplot.html
http://www.scribd.com/doc/64886201/gnuplot-1
http://nautimodelismo.tripod.com/escalasespanhol.htm