PC

2
Entropia (Shanon) A C G T Pa=1/2 ua=1 bit, uc=2 bits, ug=3 bits, ut= 3 bits Pc=1/4 -(0,5 * lg(0,5)) + 0,25 * (0,25)... Pg=1/8 Pt=1/8 Qual significado de um sinal ter, por exemplo, 1,67 bits por símbolo? Significa que ao converter o sinal original numa string de bits (1's e 0's), haverá em média 1,67 dígitos binários para cada símbolo da sigla original. H=log2 n → Equiparável Entropia conjunta (2 a 2) A B C D E a 4 5 5 5 19 b 9 1 0 0 10 c 2 3 0 0 5 d 5 0 0 0 5 ½ * - (4/19 * lg(4/19) + 5/19 lg(5/19)....+ ¼ * - (9/10 * lg(4/10) + … =============================================== Hamming Adicionar os bits na ordem e verificar erro. Sindrome Culpado 001 7 010 6 100 5 011 4 101 1 110 2 111 3 CRC (correção de erro) Redundância cíclica (CRC)[editar | editar código-fonte] Caracterizado por ser de boa eficiência, que funciona basicamente em cima de uma concordância polinomial gerador “G(x)”, que quanto maior o grau deste G, maior a eficiência desse método para detectar um erro. Deixamos claro aqui que o neste polinômio, o bit de maior e menor ordem devem obrigatoriamente ser iguais a 1. Seguindo o exemplo: palavra inicial: 10110001, o polinômio p(x) é igual aos bits da palavra inicial somada com bits de paridade, além disso, deve ser divisível pelo polinômio gerador G(x), ou seja, deve dar resto “0”, caso não dê indica que houve erro. Ocorrendo erro, para detectar, este método faz com que o receptor receba T(x)+E(x) em vez de receber o polinômio T(x) apenas, destacando que cada bit “1” em E(x) corresponde um bit inverso e,pegando T(x) e dividir por G(x) o resultado será sempre “0”. Observando o exemplo: tendo a mensagem com bits 10111011, é calculado o polinômio do gerador, utilizando a fórmula: G(x) = x4 + x + 1 resultando em 10011, conforme a mensagem já citada e, para enviar ao receptor é adicionado nessa mensagem ainda a quantidade de zeros determinado pela equivalência do grau do gerador G(x), ficando como: 10111011 0000. Logo em seguida é feita a divisão da mensagem original sem os zeros do gerador com o polinômio gerador utilizando a operação XOR, ou seja: 101110110000 / 10011 No fim desta divisão sobra resto 01111, que é adicionado à mensagem original ficando: 101110111111, e é aqui com este código a mais que se detecta se houver erro, pois no receptor é novamente calculado este mesmo resto e caso não de o mesmo resultado é detectado e avisado o erro. 10111011 ### G = 100000111 (CRC-8) D G D=0101 0111 Shift: 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1)cada bit de D é usado para computar R alternando 1 bit em D, gerando R diferente. 2)mesmo mudanças pequenas em D geram R's distintos. 3)a chance de ocorrência dos diferentes R's é a mesma (distr. unif). Ahuffman 'm' 'm' 0 'i' 'm' 0 'i' 00 's' 'm' 0 'i' 00 's' 101 Codificação aritmética Simbolo Prob Faixa A 4/10 0.0 – 0.4 B 3/10 0.4 – 0.7 C 1/10 0.7 – 0.8 # 2/10 0.8 – 1.0 PPM É um método baseado em abordagem estatística adaptativa aliada a modelagem de contexto e técnicas de predição de ocorrência de símbolos. Costuma requer um aporte maior de memória RAM, em comparação a outros métodos. Uma família relevante de algoritmos desta classe é a família PAQ de algoritmos. COLORADO 2 1 0 -1 Saída - - C:1 ½ 0 Esc:1 ½ ½ |–-|---| 1 1 1 2/28(fração C) - C->O: 1 ½ Esc: 1 ½ C: 1 ¼ O: 1 ¼ Esc: 2/4 |–|-|--| 1 1 ½ 17/28 (fração O) Esq > CO->L: 1 C->O: 1 ½ C: 1 1/5 1 1 ½ fração L Esc: 1 Esc: 1 ½ –------------ O->L: 1 ½ Esc: 1 ½ L: 1/6 O: 1/6 Esc: 3/6 CO->L: 1 Esc: 1 –--------- OL-> 1 Esc: 1 C->O: 1 Esc: 1 –----------- O->L: 1 Esc: 1 –----------- L->O: 1 Esc: 1 C: 1 1/7 L: 1/7 O: 2 2/7 Esc: 3/7 1 1 1/3 LFSR:Linear feedback shift registers - LFSR: keystream generator, produzem sequencias de grande período; composto por L estágios (numerados de 0 a L-1), onde cada estágio é capaz de armazenar 1 bit, e possuíndo uma entrada e uma saída; um clock controla a movimentação dos dados. LCG (Gerador Congruente Linear) Aditivo: Multiplicativo: C=0 X0 17 1 106 0,1061061061 a 6 2 640 0,6406406406 c 4 3 844 Res/m-1 m 1000 4 68 Tausworthe bi = (bi−r + bi−k) mod 2 - bi = bi−r bi−k RC4: is a binary additive stream cipher. It uses a variable sized key that can range between 8 and 2048 bits in multiples of 8 bits (1 byte). This means that the core of the algorithm consists of a keystream generator function. This function generates a sequence of bits that are then combined with the plaintext with XOR. Decryption consists of re-generating this keystream and XOR’ing it to the ciphertext, undo’ing it. RC4 is a binary additive stream cipher. It uses a variable sized key that can range between 8 and 2048 bits in multiples of 8 bits (1 byte). This means that the core of the algorithm consists of a keystream generator function. This function generates a sequence of bits that are then combined with the plaintext with XOR. Decryption consists of re-generating this keystream and XOR’ing it to the ciphertext, undo’ing it. The Key Schedule Algorithm of RC4 is shown in Figure 1. It accepts as input the key stored in K, and is l bytes long. It starts with the identity permutation in S and, using the key, continually swapping value to produce a new unknown key-dependent permutation. Since the only action on S is to swap two value, the fact that S contains a permutation is always maintained. One round of RC4 outputs an n bit word as keystream, which can then be XOR’ed with the plaintext to produce the ciphertext. For i = 0 to 2n − 1 S[i] = i j = 0 For i = 0 to 2n − 1 j = j + S[i] + K[i mod l] Swap(S[i], S[j]) Initialization: i = 0 ; j = 0 Generation Loop: i = i + 1 ; j = j + S[i] ; Swap(S[i], S[j]) Output z = S[S[i] + S[j]]

description

Infos about Unisino's course

Transcript of PC

Entropia (Shanon) A C G TPa=1/2 ua=1 bit, uc=2bits, ug=3 bits, ut= 3 bitsPc=1/4 -(0,5 * lg(0,5)) + 0,25 * (0,25)...Pg=1/8 Pt=1/8Qual significado de um sinal ter, por exemplo, 1,67 bits por símbolo? Significa que ao converter o sinal original numa string de bits (1's e 0's), haverá em média 1,67 dígitos binários para cada símbolo da sigla original.H=log2 n → Equiparável

Entropia conjunta (2 a 2)

A B C D Ea 4 5 5 5 19b 9 1 0 0 10c 2 3 0 0 5d 5 0 0 0 5

½ * - (4/19 * lg(4/19) + 5/19 lg(5/19)....+¼ * - (9/10 * lg(4/10) + …

===============================================HammingAdicionar os bits na ordem e verificar erro.

Sindrome Culpado001 7010 6100 5011 4101 1110 2111 3

CRC (correção de erro)Redundância cíclica (CRC)[editar | editar código-fonte] Caracterizado por ser de boa eficiência, que funciona basicamente em cima de uma concordância polinomial gerador “G(x)”, que quanto maior o grau deste G, maior a eficiência desse método para detectar um erro. Deixamos claro aqui que o neste polinômio, o bit de maior e menor ordem devem obrigatoriamente ser iguais a 1.

Seguindo o exemplo: palavra inicial: 10110001, o polinômio p(x) é igual aos bits da palavra inicial somada com bits de paridade, além disso, deve ser divisível pelo polinômio gerador G(x), ou seja, deve dar resto “0”, caso não dê indica que houve erro.

Ocorrendo erro, para detectar, este método faz com que o receptor recebaT(x)+E(x) em vez de receber o polinômio T(x) apenas, destacando que cada bit “1” em E(x) corresponde um bit inverso e,pegando T(x) e dividir por G(x) o resultado será sempre “0”. Observando o exemplo: tendo a mensagem com bits 10111011, é calculado o polinômio do gerador, utilizando a fórmula: G(x) = x4 + x + 1 resultando em 10011, conforme a mensagem já citada e, para enviar ao receptor é adicionado nessa mensagem ainda a quantidade de zeros determinado pela equivalência do grau do gerador G(x), ficando como: 10111011 0000. Logo em seguida é feita a divisão da mensagem original sem os zeros do gerador com o polinômio gerador utilizando a operação XOR, ou seja: 101110110000 / 10011 No fim desta divisão sobra resto 01111, que é adicionado à mensagem original ficando: 101110111111, e é aqui com este código a mais que se detecta se houver erro, pois no receptor é novamente calculado este mesmo resto e caso não de o mesmo resultado é detectado e avisado o erro.

10111011 ### G = 100000111 (CRC-8) D GD=0101 0111

Shift:0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0

1 0 0 0 0 0 1 1 10 0 1 0 1 1 0 1 1 0 0

1 0 0 0 0 0 1 1 10 0 1 1 0 1 0 1 1 0 0

1 0 0 0 0 0 1 1 10 1 0 1 0 1 0 1 1 0

1 0 0 0 0 0 1 1 10 0 1 0 1 0 0 0 1

1)cada bit de D é usado para computar R alternando 1 bit em D, gerando R diferente.2)mesmo mudanças pequenas em D geram R's distintos.3)a chance de ocorrência dos diferentes R's é a mesma (distr. unif).Ahuffman

'm' 'm' 0 'i'

'm' 0 'i' 00 's'

'm' 0 'i' 00 's'101

Codificação aritméticaSimbolo Prob Faixa

A 4/10 0.0 – 0.4B 3/10 0.4 – 0.7C 1/10 0.7 – 0.8# 2/10 0.8 – 1.0

PPMÉ um método baseado em abordagem estatística adaptativa aliada a modelagem de contexto e técnicas de predição de ocorrência de símbolos. Costuma requer um aporte maior de memória RAM, em comparação a outros métodos. Uma família relevante de algoritmos desta classe é a família PAQ de algoritmos.COLORADO

2 1 0 -1 Saída

- -C:1 ½ 0

Esc:1 ½ ½ |–-|---| 1 1 1 2/28(fração C)

-C->O: 1 ½ Esc: 1 ½

C: 1 ¼ O: 1 ¼

Esc: 2/4 |–|-|--|

1 1 ½ 17/28 (fração O) Esq >

CO->L: 1 C->O: 1 ½ C: 1 1/5 1 1 ½ fração L

Esc: 1

Esc: 1 ½ –------------O->L: 1 ½ Esc: 1 ½

L: 1/6O: 1/6

Esc: 3/6

CO->L: 1Esc: 1

–---------OL-> 1Esc: 1

C->O: 1Esc: 1

–-----------O->L: 1Esc: 1

–-----------L->O: 1

Esc: 1

C: 1 1/7L: 1/7

O: 2 2/7Esc: 3/7

1 1 1/3

LFSR:Linear feedback shift registers - LFSR: keystream generator, produzem sequencias de grande período; composto por L estágios (numerados de 0 a L-1), onde cada estágio é capaz de armazenar 1 bit, e possuíndo uma entrada e uma saída;um clock controla a movimentação dos dados.

LCG (Gerador Congruente Linear)Aditivo: Multiplicativo: C=0

X0 17 1 106 0,1061061061a 6 2 640 0,6406406406c 4 3 844 Res/m-1m 1000 4 68

Tausworthebi = (bi−r + bi−k) mod 2 - bi = bi−r bi−k⊕RC4: is a binary additive stream cipher. It uses a variable sized key that can range between 8 and 2048 bits in multiples of 8 bits (1 byte). This means that the core of the algorithm consists of a keystream generator function. This function generates a sequence of bits that are then combined with the plaintext with XOR. Decryption consists of re-generating this keystream and XOR’ing it to the ciphertext, undo’ing it. RC4 is a binary additive stream cipher. It uses a variable sized key that can range between 8 and 2048 bits in multiples of 8 bits (1 byte). This means that the core of the algorithm consists of a keystream generator function. This function generates a sequence of bits that are then combined with the plaintext with XOR. Decryption consists of re-generating this keystream and XOR’ing it to the ciphertext, undo’ing it. The Key Schedule Algorithm of RC4 is shown in Figure 1. It accepts as input the key stored in K, and is l bytes long. It starts with the identity permutation in S and, using the key, continually swapping value to produce a new unknown key-dependent permutation. Since the only action on S is to swap two value, the fact that S contains a permutation is always maintained. One round of RC4 outputs an n bit word as keystream, which can then be XOR’ed with the plaintext to produce the ciphertext.

For i = 0 to 2n − 1 S[i] = i j = 0

For i = 0 to 2n − 1 j = j + S[i] + K[i mod l]

Swap(S[i], S[j])

Initialization: i = 0 ; j = 0

Generation Loop: i = i + 1 ; j = j + S[i] ; Swap(S[i], S[j])

Output z = S[S[i] + S[j]]

DES: O DES foi criado em 1977. Foi adotado pelo National Bureau of Standards, atualmente conhecido como National Institute of Standards and Technology. Seu funcionamento básico consiste na criptografia de blocos de 64 bits de entrada com uma chave de 56 bits, gerando blocos de 64 bits como saída. Para obter o texto original novamente, reverte-se o processo usando a mesma chave. Devido ao pequeno tamanho desta, esse algoritmo já não é considerado seguro, pois ele poderia ser quebrado com certa facilidade pela força bruta. Outro ponto que gera certa apreensão é o fato de existirem blocos internos ao DES cujo critério de arquitetura não foi explicitado, levando muitos a crer que existiriam falhas internas não reveladas pelo autor. O texto cifrado é gerado a partir de 16 interações entre as permutações do texto inicial e da chave. O texto plano foi dividido em dois blocos de 32 bits. O Bloco de 32 bits de saída da esquerda será igual ao bloco de entrada dadireita. Já o bloco de saída da direita corresponderá a uma série de processos utilizando os blocos da direita, os da esquerda e também a chave. Primeiramente, é feita uma expansão e, em seguida, uma permutação no bloco da direita, segundo uma tabela pré-determinada.Após este passo, é feito um XOR entre um subproduto da chave, e, em seguida, o resultado dessa operação é enviado para as S-Boxes. Logo depois, é feita uma nova permutação, segundo uma outra tabela, que juntamente com o bloco da direita entrará em um novo XOR, resultando no bloco dadireita final.IDEA: Technically IDEA is block cipher. Like DES, it alsoworks on 64 bit plain text block. The key is longer andconsists of 128 bits. IDEA is reversible like DES, that is,same algorithm is used for encryption and decryption. IDEAuses both diffusion and confusion for encryption. The 64-bitinput plaintext block P is divided into 4 portions, each of 16bits (P1 to P4). Thus, P1 to P4 are the inputs to the firstround of the algorithm. There are eight such rounds. Thekey consist of 128 bits.In each round, six sub keys are generated from the originalkey. Each of the sub-keys os of 16 bits. These six sub-keysare applied to the four input blocks P1 to P4. Thus for thefirst round we will have the six keys K1 to K6. Similarly foreightth round we will have keys K43 to K48. The final stepsconsist of an output transformation, which uses just four sub-keys (K49 to K52).Thefinal output produced is the output produced by the output transformation step, which is four blocks of cipher named C1 to C4(each of 16 bits).These are combined to form the final 64 bit cipher text block. 1.Multiply X1 and the first subkey K1/2.Add X2 and the second subkey K2./3. Add X3 and the third subkey K3./4.Multiply X4 and the fourth subkey K4/5.Bitwise XOR the results of steps 1 and 3/6.Bitwise XOR the results of steps 2 and 4/7.Multiply the result of step 5 and the fifth subkey K5/8.Add the results of steps 6 and 7/9.Multiply the result of step 8 and the sixth subkeyK6./10. Add the results of steps 7 and 9./11. Bitwise XOR the results of steps 1 and 9./12. Bitwise XOR the results of steps 3 and 9./13. Bitwise XOR the results of steps 2 and 10/14. Bitwise XOR the results of steps 4 and 10.Forevery round except the final transformation, aswap occurs, and the input to the next round is: resultof step 11 k result of step 13 k result of step 12 k result of step 14, which becomes X1 k X2 k X3 k X4,the input for the next round. After round 8, a ninth“half round” final transformation occurs: 1.Multiply X1 and the first subkey./2.Add X2 and the second subkey.3/Add X3 and the third subkey./4.MultiplyX4 and the fourth subkey. Finally, the four sub-blocks are reattached to producethe ciphertext.BLOWFISH: There are two parts to this algorithm; a part that handles the expansion of the key and a part that handles the encryption of the data. The first stepin the algorithm is to break the original key into a set of subkeys. Specifically, a key of no more than 448 bits is separated into 4168 bytes. There is a P-array and four 32-bit S-boxes. The P-array contains 18 32-bit subkeys, while each S-box contains 256 entries.Initialize the P-array and S-boxes: XOR P-array with the key bits. For example, P1 XOR (first 32 bits of key), P2 XOR (second 32 bits of key)...Use the above method to encrypt the all-zero string. This new output is now P1 and P2.Encrypt the new P1 and P2 with the modified subkeys.This new output is now

P3 and P4. Repeat 521 times in order to calculate new subkeys for the P-array and the four S-boxes.AES: The block cipher Rijndael is designed to use only simple whole-byte operations. Also, it provides extra flexibility over that required of an AES candidate,in that both the key size and the block size may be chosen to be any of 128, 192, or 256 bits. (During an early stage of the AES process, a draft version of the requirements would have required each algorithm to have three versions, with both the key and block sizes equal to each of 128, 192, and 256 bits. This was later changed to make the three required versions have those three key sizes, but only a block size of 128 bits, which is more easily accomodated by many types of block cipher design.). Rijndael has a variable number of rounds. Not counting an extra round performed at the end of encipherment with one step omitted, the number of rounds in Rijndael is:9 if both the block and the key are 128 bits long. 11 if either the block or the key is 192 bits long, and neither of them is longer than that.13 if either the block or the key is 256 bits long. To encipher a block of data in Rijndael, you first perform an Add Round Key step (XORing a subkey with the block) by itself, the regular rounds noted above, and as already noted, the final round with the Mix Column step, as described below, omitted. SubBytes—a non-linear substitutionstep where each byte is replaced with another according to a lookup table.In the SubBytes step, each byte in the state matrix is replaced with a SubByte using an 8-bit substitution box, the Rijndael S-box. Next is the Shift Row step. Considering the block to be made up of bytes 1 to 16, these bytes are arranged in a rectangle, andshifted.For blocks of sizes 128 bits and 192 bits, the shifting pattern is the same. Row n is shifted left circular by n-1 bytes.For a 256-bit block, the first row is unchanged and the shifting for the second, third and fourth row is 1 byte, 3 bytes and 4 bytes respectively. Next comes the Mix Column step the four bytes of each column of the state are combined using an invertible linear transformation. The MixColumns function takes four bytes as input and outputs four bytes, where each input byte affects all four output bytes. Together with ShiftRows, MixColumns provides diffusion in the cipher. This operation is used as an inner loop in the key schedule, and is done in the following manner: The input is a 32-bit word and at an iteration number i. The output is a 32-bit word. Copy the input over to the output. Use the above described rotate operation to rotate the output eight bits to the left Apply Rijndael's S-box on all four individual bytes in the output word On just the first (leftmost) byte of the output word, exclusive OR the byte with 2 to the power of (i-1). In other words, perform the rcon operation with i as the input, and exclusiveor the rcon output with the first byte of the output word.MD5: Hash 128 bits (4 blocos de 32). Processa o texto de entrada em blocos de 512 bits(16 x 32).Step 1. Appending Padding Bits. The original message is "padded" (extended) so that its length (in bits) is congruent to 448, modulo 512. The padding rules are: The original message is always padded with one bit "1" first. Then zero or more bits "0" are padded to bring the length of the message up to 64 bits fewer than a multiple of 512. Step 2. Appending Length. 64 bits are appended to the end of the padded message to indicate the length of the original message in bytes. The rules of appending length are: The length of the original message in bytes is converted to its binary format of 64 bits. If overflow happens, only the low-order 64 bits are used. Break the 64-bit length into 2 words (32 bits each). The low-order word is appendedfirst and followed by the high-order word. Step 3. Initializing MD Buffer. MD5 algorithm requires a 128-bit buffer with a specific initial value. The rules of initializing buffer are: The buffer is divided into 4 words (32 bits each), named as A,B, C, and D. Word A is initialized to: 0x67452301.Word B is initialized to: 0xEFCDAB89.Word C is initialized to: 0x98BADCFE.Word D is initialized to: 0x10325476. Step 4. Processing Message in 512-bit Blocks. This is the main step ofMD 5 algorithm, which loops through the padded and appended message in blocks of 512 bits each. For each input block, 4 rounds of operations are performed with 16operations in each round.SHA-1:Task 1. Appending Padding Bits. The original message is "padded" (extended) so that its length (in bits) is congruent to 448, modulo 512. The padding rules are: The original message is always padded with one bit "1" first. Then zero or more bits "0" are padded to bring the length of the message up to 64 bits fewer than a multiple of 512. Task 2. Appending Length. 64 bits are appended to the end of the

padded message to indicate the length of the original message in bytes. The rules of appending length are: The length of the original message in bytes is converted to its binary format of 64 bits. If overflow happens, only the low-order 64 bits are used. Break the 64-bit length into 2 words (32 bits each). The low-order word is appendedfirst and followed by the high-order word. Task 3. Preparing Processing Functions. SHA1 requires 80 processing functions defined as: f(t;B,C,D) = (B AND C) OR ((NOT B) AND D) ( 0 <= t <= 19);f(t;B,C,D) = B XOR C XOR D (20 <= t <= 39);f(t;B,C,D)= (B AND C) OR (B AND D) OR (C AND D)(40 <= t <= 59);f(t;B,C,D) = B XOR C XOR D (60 <= t <= 79) Task 4. Preparing Processing Constants. SHA1 requires 80 processing constant words defined as:K(t) = 0x5A827999 ( 0 <= t <= 19);K(t) = 0x6ED9EBA1 (20 <= t <= 39);K(t) = 0x8F1BBCDC (40 <= t <= 59);K(t) = 0xCA62C1D6 (60 <= t <= 79);Task 5. Initializing Buffers. SHA1 algorithm requires 5 word buffers with the following initial values:H0 = 0x67452301;H1 = 0xEFCDAB89;H2 = 0x98BADCFE;H3 = 0x10325476;H4 = 0xC3D2E1F0.Task 6. Processing Message in 512-bit Blocks. This is the main taskof SHA1 algorithm, which loops through the padded and appended message in blocks of 512 bits each. For each input block, a number of operations are performed.Step 5. Output. The contents in H0, H1, H2, H3, H4, H5 are returned in sequence the message digest.RSA:As chaves são geradas desta maneira:Escolha de forma aleatória dois números primos grandes p e q, da ordem de 10^100 no mínimo.Compute n = pq,Compute a função totiente (phi) em n: phi(n) = (p-1)(q-1). Escolha um inteiro e, tal que 1 < e, < phi(n), de forma que e e phi(n), sejam primos entre si.Dois números sãoprimos entre si quando o Máximo Divisor Comum (MDC) entre eles é 1.Compute d,de forma que de EQUIV 1 mod(phi(n)), ou seja, d seja o inverso multiplicativo de e,em mod(phi(n)).No passo 1 os números podem ser testados probabilisticamente paraprimalidade.No passo 5 é usado o algoritmo de Euclides estendido, e o conceito de inverso multiplicativo que vem da aritmética modular Por final temos: A chave pública: o par de números n, e e A chave privada: o par de números n, e d. Para transformar uma mensagem m, onde 0<m<n, numa mensagem c cifrada usando a chave pública do destinatário n e e basta fazer uma potenciação modular: c = m^e mod n. A mensagem então pode ser transmitida em canal inseguro para o receptor. Há um algoritmo para realizar esta potência rapidamente. Para recuperar a mensagem m da mensagem cifrada c usando a respectiva chave privada do receptor n e d, basta fazer outra potenciação modular:m = c^d mod n.SHA-3 hash function was the support of the following output lengths:224 bits;256 bits;384 bits;512 bits.SHA-3 uses the sponge construction[6][7] in which message blocks are XORed into the initial bits of the state, which is then invertibly permuted.In the version used in SHA-3, the state consists of a 5×5 array of 64-bit words, 1600bits total.This is defined for any power-of-two word size, w = 2ℓ bits. The main SHA-3 submission uses 64-bit words, ℓ = 6.The state can be considered to be a 5×5×w array of bits. Let a[i][j][k] be bit (5i + j) × w + k of the input, using a little-endian bit numbering convention. Index arithmetic is performed modulo 5 for the first two dimensions and modulo w for the third.The basic block permutation function consists of 12 + 2ℓ iterations of five sub-rounds, each individually very simple: Absorb process:After the message has been padded it is split into 5x5 blocksthat are xor’ed into the state one by one. Between every xor the state is updated using the Keccak-f[] function. Squeeze process:This step builds the output string and works in a similar fashion as the absorb step. But instead of xor’ing blocks into the state it appends the output from the Keccak-f[] function to the output string untilno further output is requested. Keccak-f:The permutation of the Keccak is the set of methods θ, ρ, π, χ and ι, run consecutively n times where n is the number of rounds [4]. θ is a linear mapping aimed at diffusion;ρ translação dentro das fileiras com objetivo de prover dispersão entre as camadas.π é uma transposição de fileiras que proporciona dispersão ao longo da difusão (sem=períodos curtos). χ the only non-linear mapping of Keccak. Worth mentioning is that χ is a complement of the linear function called γ used in several other ciphers, e.g. PANAMA or RADIOGATUN. ι provides protection against symmetry attacks, e.g. slide attack. By adding round constants to the state and therefore adding symmetry dispersion.