Materias

martes, 30 de octubre de 2012

Entrada # 3

Programa # 1 Estabilidad

Para esta ocasión tenemos que demostrar la estabilidad de nuestras funciones de transferencia, antes de comenzar les muestro nuestra función:




A continuación tenemos el comportamiento de los polos y ceros en forma gráfica de la función de transferencia:


Como vemos en la imagen vemos en la imagen, la función tiende a ser estable hasta un cierto punto en el cuál su comportamiento se vuelve inestable.

Después tenemos el código utilizado como vemos en los comentarios, los valores de la Resistencia y el Calor son Constantes, estos son inicializados a 1 para que no apliquen un gran cambio en el resultado:


El resultado del código lo mostramos a continuación, el resultado no muestra el comportamiento con distintas Intensidades de entrada y con sus respectiva gráfica cuando se le aplica un ruido (este ruido fue realizado mediante la función seno y un tiempo de 0 y 20 con .001 entre cada uno):

Con 2

                                                                        Entradas


                                                                       Con Ruido



Con 12

                                                                                Entradas



                                                                               Con Ruido



Con 32

                                                                               Entradas



                                                                             Con Ruido



Con 100
                                                                                Entradas



                                                                               Con Ruido



Como vemos en todas las imágenes anteriores, las gráficas nunca se detienen en un punto en especifico, por lo tanto se mantiene la propuesta de que nuestra función tiende a ser inestable.

jueves, 25 de octubre de 2012

Entrada # 8

Stream Ciphers

The stream ciphers are algorithms that can to perform encryption incrementally converting plaintext into ciphertext bitwise.

To accomplish this we construct a keystream generator (bit sequence undefined size which can be used to encrypt the data stream by combining the keystream to the data stream using the XOR function).

If the key stream is secure, encrypted data flow will be too.

For this week commissioned us choose a stream cipher and explain, for this occasion I chose:ISAAC.


Stream Cipher ISAAC

History


The letters are an acronym of ISAAC Indirection, Shift, Accumulate, Add, and Count, this was created in 1996 by Robert John Jenkins Jr.

This is not only a stream cipher safe but also a pseudorandom number generator.

This encryption shares many similarities with the RC4.

ISAAC is used by Unix Shred as a tool to overwrite data securely.


Description oh the Cipher


It consists of an array of 256 of 4-bit integers (known as 'mm') as input, writing the results in another vector of 256 integers (known as 'm'), which are read one at a time until it is empty, and is then recomputed.

The calculation is to alter the vector mm [i] with (i ⊕ 128) to each vector element, two elements are found by vector mm indirectly, an accumulator and a counter, for all values ​​of i from 0 to 255 .

As you only need 19 operations of 32 bits for each output word of 32 bits, is extremely fast 32-bit computers.


Atacks y/o Vulnerabilitys

In 2001, Marina Pudovkina in said an attack can recover the input data about a complexity less than the time required to search through the square root of all possible initial states.

To achieve such an attack would mean that this attack needs 4.67 \times 10^{1240} time instead 10^{2466}.This result has no practical impact on the security of ISAAC .

Among the most important is that in 2006, Jean-Philippe Aumasson discovered several series of weak states in the encryption, as this is based on RC4 has a weakness like this (this exit leads to a very similar to the ISAAC first round, and allows the derivation of the internal state, so that they could detect the input data).

Although it is unclear whether this weakness an attacker can ensure the output only if the generator is in one of these states or weak.

There is an attack on this cipher ISAAC in 2006 in Asiacrypt'06 by Paul and Bart Preneel Souradyuti, this attack demonstrate that it is of great importance, since it is based on an algorithm wrong.

Finally, a modified algorithm is proposed to fix the weaknesses discovered in the states, this change arises in an improved version called ISAAC +.

So far not been a successful attack, but that does not ensure that in the future there is the possibility of an attack.


Start the Cipher

For explanation it will be used encryption 8 data entry is required because the key which is required in the same length as the output, so that the size of the key will be the same size or 8.

Before encryption must consider a few things that you use this:

Size: The size of the key and, on this occasion is 8.

mm: Fix input

m: Output Agreement

It makes use of a process that is widely used, this is known as mix ():


This use elements of the key y save in variable (a ... h)




Graphic Form:

Another important function is the function rngstep (), this is the most important of this encryption key generator.

This does the following:
  • Stores the current memory into a register
  • Set the new value of the accumulator
  • Set the next memory bit to the addition of 2-9 bits xo current memory and the accumulator with the above result.
  • Finally, the results of the matrix is increased and began adding bits x 10 -17 and right scroll 8 bits.

This code form and in visual form:




Beginning with Steps

Firsth.- Load the eight elements of the key variables, run the mix () to randomize them, the results are loaded into the eight elements of the array. This process is repeated until the key has expired.




Second.- The same process is made to mix more thoroughly, but now load the items in the array instead of the key elements in integers.




All this was to hold the keys and mixing arrangement as possible.

Would then process the main part, this has two steps:


Firsth.- It adds a counter called B, then calls the function rngstep () four times with different bitshifts of A for which the mix is ​​best.




Second.- Make a second M2 for but, going from the first element to be repaired, calling rngstep () four times in each iteration.

This step is designed to Ensure That m2 at each array is at least one index for rngstep ().



References

http://es.wikipedia.org/wiki/Cifrador_de_flujo
Aquí puedes encontrar el código de este cifrado en distintos lenguajes.
http://en.wikipedia.org/wiki/ISAAC_(cipher)
http://www.cs.rit.edu/~ark/spring2012/482/team/u3/presentation1.pdf
http://www.burtleburtle.net/bob/rand/isaac.html
http://docs.python.org/reference/expressions.html#binary-bitwise-operations
http://eprint.iacr.org/2006/438

jueves, 18 de octubre de 2012

Entrada # 4


Laboratorio de Automatización y Control de Sistemas Dinámicos


Para esta semana consistió en elegir un problema y resolverlo.

Primeramente el Problema Elegido:

Determine el rango de valores de K para la estabilidad de un sistema de control con realimentación unitaria cuya función de transferencia en lazo abierto es


En base al libro de Ogata nos dice que para los problemas de estabilidad hay que multiplicar el denominador y nominador con tal de que no exista multiplicación alguna en ellos, quedaría:


Pero como tenemos un valor en el numerador tenemos que pasarlo al denominador, nos quedaría:


Tenemos que:


Y


En base a las ecuaciones anteriores nos quedaría lo siguiente:


En base a la imagen anterior nos quedaría que:


Para determinar el rango de K habrá que tomar los términos de s que contengan a K e igualarlos a 0 cada uno, y esos dos valores serian el rango de K.


------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------
Por lo tanto el rango de K debería de ser:


y



 O dicho de otra manera:


Referencias:

Modern Control Engineering Fourth Edition
Katsuhiko Ogata

Entrada # 7

Reporte # 2

Blocks Ciphers

First shall begin with a little explanation about what this is.

Consists of a symmetric key cipher (in which the same key is used to encrypt and decrypt messages) that operates on groups of bits of fixed length, called blocks, applying a transformation invariant.

When performing encryption, this takes a block of plain text as input and produces a ciphertext of the same size as the original text.

For this week is to choose one of the existing encrypted and explain.


Akelarre Cipher

Who and When Proposing


Was design for G. Álvarez Marañón, D. Guía Martínez, F. Montoya Vitini, A. Peinado Domínguez in 1996.


Mejoras que tenía de los ya existentes


Akelarre combines the best of this cipher's:


      IDEA.- 
Handles multiple arithmetic.
      RC5.- Rotation of Keys.

This encryption aims to be a strong encryption system most efficient.

How it Works

First we have a define the next points:



Variable numbers of rounds
  •      The autors claim the 4 rounds is more safe.
  •      Although the reality is unsafe for any number of rounds!
Block length is 128 bits

Key length can be any multiple of 64 bits
  •      The common lenght of the key is the 128 bits.
Lots of blocks subkey: 13R + 8
  • Every of the subkeys its a word of 32 bits.
Mod also employs 232 and XOR

Adding rotation (AR) structure

Proceso del Cifrado

For the encryption:

  • Inputs data, this we have transformating for your use
  • Round 0,1,2, ..., R-1
  • Cifred data
Explain of more extensing form:




Taking: 


(A0, A1, A2, A3), this would be the input to round r.
(B0, B1, B2, B3), the output would rotation keys.


Then Apply the struct of Akelarre
(B0, B1, B2, B3) = (A0, A1, A2, A3) <<<<
Where "<<<" is left rotation and (X)_i_\ldots_j, this means bits i thru j (inclusive) of X

  • Recall, the bits enumerating the left to right, started in 0

Explain of visual form:


Where:
  • W = X
  • W1 make first
  • Rotate 31 bits, with 1 bit fixed
Taking:

(T0 ,T1), output would AR structure

(T0 ,T1) = AR(B0 ⊕ B2, B1 ⊕ B3), indicating the input values ​​and which has the form AR obtain these.

Later: 

(D0, D1, D2, D3), output would round r.

Then:

(D0, D1, D2, D3) = (B0⊕T1, B1⊕T0, B2⊕T1, B3⊕T0)

One Time to Finished This:

The Block (D0, D1, D2, D3) whold:
  • The entrance of the next round.
  • If the last one, whold the output of all the process.
For the decryption process would use the same process only data that would introduce a little different.




Math Type which is based

As based on IDEA uses XOR (⊕) combined with rotation values, and modular arithmetic.


Example


The following is a problem which show difficulties if used have certain values ​​in this.


-------------------------------------------------------------------------------------------------------------------


Only to start:

  • z is K in the explication.

Given X = (0x53,0x8d,0x86,0x80), Y = (0x74,0x21,0x9c,0xca):

Create an equation, substituting in the values for x and y:



(0x53-z5) ^ 0x86 ^ z7 = (0x74 + z1) ^ 0x9c ^ z3

Starting with the low-order bit (denoted zi[0]), determine which of the following bit combinations solve the above equation:


(z5[i],z1[i],z3[i]^z7[i]) = ((0,0,0),(0,0,1),...,(1,1,0),(1,1,1))

Provided sufficient plaintext-ciphertext pairs, it should theoretically be possible to uniquely determine the values of the unknown subkeys using this technique.

In order to solve for the unknown plaintext, we need to solve the below equation:


We know the entire right-hand side of the equation and z1 on the left-hand side.

Given sufficient redundancy, it is possible to determine the values of x1 and x3. The papers we read did not go into detail about how to perform this recovery.

Determining z1...z8:

Tried multiple approaches that either resulted in hundreds of potential subkey values, or did not find a single subkey value

           Bit-by-bit as described
                           Resulted in hundreds of matches
           Bit-by-bit, taking carry bits into consideration
                           Resulted in zero matches
           Byte-by-byte bruteforce attack
                           Worked if the input size was a single byte, but did not work otherwise

-------------------------------------------------------------------------------------------------------------------

Let

A = (A0, A1, A2, A3), be input to round r
U = (U0, U1, U2, U3), be result of rotation
T = (T0, T1), be output of AR structure
B = (B0, B1, B2, B3), be output of round r

Denote A = (a0 ,a1,…,a127)
  • And similarly for U,T,B
Let l be size of keyed rotation

Then U = (A <<< l) and (B0, B1, B2, B3) = (U0⊕T1, U1⊕T0, U2⊕T1, U3⊕T0)

It follows that B0⊕B2 = U0⊕U2 and B1⊕B3 = U1⊕U3

AR structure has vanished!

The crucial observation for attack

Atacks Y/O Vulnerabilities

Akelarre shows that your design is complicated encryption.

An attack is conceptually simple, but the details are not so simple.

There is an attack in the year 1997, using Ciphertext-only attack.

It therefore proves to be very vulnerable to attacks.

References:


http://www.schneier.com/paper-akelarre.pdf

http://es.wikipedia.org/wiki/Akelarre_(cifrado)
http://www.sacconference.org/proc/SAC_96_002.pdf
http://es.wikipedia.org/wiki/Cifrado_por_bloques
http://en.wikipedia.org/wiki/Akelarre_(cipher)
http://cs.sjsu.edu/~stamp/crypto/PowerPoint_PDF/12_Akelarre.pdf

martes, 9 de octubre de 2012

Entrada 2



Automatización y Control de Sistemas Dinámicos


Diagrama de Bloques

Para esta entrada consiste en mostrar el diagrama de bloques de la función de transferencia de nuestro proyecto.

Antes de hacer esto, completare la función de transferencia que había hecho en el reporte pasado.

Viendo los valores de entrada y salida (http://materiasdepedrito.blogspot.mx/2012/09/reporte-1.html) tenemos que:

El valor de entrada sería seria la Potencia de la corriente eléctrica, la ecuación de esta es:

P = \frac{dq}{dt} I R

P = Potencia de la corriente eléctrica.
I = Intensidad de la corriente.
R = Resistencia del material del que esta hecho la punta del cautín.
dq/dt = Derivada del calor respecto al tiempo.

El valor de salida seria el Calor producido por el cautín, la ecuación de esta seria:


Q = Calor
m = Masa del Cautín
c = Calor especifico del cautín
Delta T = Diferencia de Temperaturas (Entrada y de Salida)

Teniendo esto la función de transferencia seria:


Aplicando la transformada de Laplace a cada una de las funciones:

Función de Entrada
X(s) = L\left\{{\frac{dq}{dt} I R}\right\}
X(s) = sQ(s) I R

Función de Salida
Y(s) = L\left\{{c m \Delta T}\right\}
Y(s) = \frac{c m \Delta T}{s}

Aplicando la estas funciones a la de transferencia tenemos nuestra función de transferencia

G(s) = \frac{\frac{c m \Delta T}{s}}{sQ(s) I R }
G(s) = \frac{\frac{c m (T_f - T_o)}{s}}{sQ(s) I R }

Ya a continuación muestro el diagrama de bloques: