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)}]$

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 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
  •  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


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.
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.
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.
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.

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).

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.


$\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.

Sistemas de Control
Diagrama de Bloques