Carregar apresentação
A apresentação está carregando. Por favor, espere
1
Criptografia Simétrica
Prof. Eduardo Bastos
2
Terminologia Básica plaintext (texto claro) – mensagem original
ciphertext (texto cifrado) – mensagem codificada cipher (cifra) – algoritmo para transformar plaintext to ciphertext key (chave) - informação usada no cifrador conhecida apenas pelo emissor/receptor encipher (criptografar) – converter plaintext em ciphertext decipher (descriptografar) – converter ciphertext em plaintext
3
Terminologia Básica criptografia- estudo dos princípios e métodos de criptografia criptoanálise (codebreaking) – estudo do princípios e métodos para decifrar textos cifrados sem o conhecimento da chave criptologia- campo do conhecimento que envolve tanto a criptografia quanto a criptoanálise
4
Criptologia
5
Criptologia
6
Criptografia Sistema criptográfico caracterizado por:
tipo de operações usadas substituição / transposição/ produto número de chaves utilizadas chave única, simétrica ou privada / duas chaves, assimétrica ou pública modo como o texto claro é processado bloco / fluxo (stream) Cryptographic systems can be characterized along these three independent dimensions.
7
Criptoanálise O objetivo é recuperar a chave e não a mensagem original
Abordagens gerais: Ataque criptoanalítico Baseia-se na natureza do algoritmo mais o conhecimento das características gerais do texto claro e amostras plain-cipher Ataque por força bruta Teste de cada chave em um texto cifrado até que uma tradução intelegível seja obtida. Typically objective is to recover the key in use rather then simply to recover the plaintext of a single ciphertext. There are two general approaches: Cryptanalytic attacks rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext-ciphertext pairs. Brute-force attacks try every possible key on a piece of ciphertext until an intelligible translation into plaintext is obtained. On average,half of all possible keys must be tried to achieve success.
8
Criptossistema Cryptographic systems can be characterized along these three independent dimensions.
9
Criptografia Simétrica
Ou convencional / chave privada / chave única. Emissor e receptor compartilham uma chave comum. Todos os algoritmos clássicos de criptografia são de chave privada. Único tipo antes da invenção dos algoritmos de chave pública na década de 70. Técnica ainda muito utilizada. Symmetric encryption, also referred to as conventional encryption or single-key encryption, was the only type of encryption in use prior to the development of public-key encryption in the 1970s. It remains by far the most widely used of the two types of encryption. All traditional schemes are symmetric / single key / private-key encryption algorithms, with a single key, used for both encryption and decryption. Since both sender and receiver are equivalent, either can encrypt or decrypt messages using that common key.
10
Modelo de Criptografia Simétrica
11
Requisitos Dois requisitos para uma criptografia simétrica segura:
algoritmo de criptografia forte chave secreta conhecida apenas pelo emissor e receptor Matematicamente: Y = EK(X) X = DK(Y) Assume-se que E é conhecido Canal seguro para a distribuição da chave
12
Ataques Criptoanalíticos
13
Mais definições… Incondicionalmente seguro Computacionalmente seguro
Não importa quanto poder computacional ou tempo disponíveis, a cifra não pode ser quebrada Computacionalmente seguro Custo para quebrar > info codificada Tempo para quebrar > vida útil da info
14
Ataque por força bruta sempre possível tentar cada chave
maioria dos ataques, proporcional ao tamanho da chave assume um texto claro conhecido ou reconhecido (não pode ser criptografado, por exemplo)
15
Cifras de substituição clássicas
Onde letras do texto original (plaintext) são trocadas por outras letras ou por outros símbolos Se o plaintext é visto como uma seqüência de bits, a substituição envolve trocar cada padrão de bits de plaintext por padrões de bit ciphertext
16
Cifras de substituição clássicas
Cifra de César Cifra Playfair Cifra de Hill Cifra de Vigenère One-Time Pad
17
Cifras de substituição clássicas
Cifra de César Cifra Playfair Cifra de Hill Cifra de Vigenère One-Time Pad
18
Cifra de César cifra de substituição mais antiga conhecida
idealizada por Julius Caesar utilizada para fins militares troca cada letra pela 3a. letra subseqüente Exemplo: FESTA CONFIRMADA NO PROXIMO SABADO A NOITE IHVWD FRQILUPDGD QR SURALPR VDEDGR D QRLWH
19
Cifra de César pode ser definida como:
a b c d e f g h I j k l m n o p q r s t u w x y z D E F G H I J K L M N O P Q R S T U V W X Y A B C matematicamente, associar um número a cada letra a b c d e f g h i j k l m n o p q r s t u v w x y z e definir a cifra de césar como: c = Ek(p) = (p + k) mod (26); p = Dk(c) = (c – k) mod (26); This mathematical description uses modulo (clock) arithmetic. Here, when you reach Z you go back to A and start again. Mod 26 implies that when you reach 26, you use 0 instead (ie the letter after Z, or goes to A or 0). Example: howdy (7,14,22,3,24) encrypted using key f (ie a shift of 5) is MTBID
20
Cifra de César This mathematical description uses modulo (clock) arithmetic. Here, when you reach Z you go back to A and start again. Mod 26 implies that when you reach 26, you use 0 instead (ie the letter after Z, or goes to A or 0). Example: howdy (7,14,22,3,24) encrypted using key f (ie a shift of 5) is MTBID
21
Cifra de César Gere o cyphertext das frases abaixo utilizando o cifrador de Cesar : reuniao de formatura pela manha (k = 3) encontre-me no estacionamento (k = 3) cifra de cesar (k = 18) criptografia (k = 20) reuniao no bar (k = 7) This mathematical description uses modulo (clock) arithmetic. Here, when you reach Z you go back to A and start again. Mod 26 implies that when you reach 26, you use 0 instead (ie the letter after Z, or goes to A or 0). Example: howdy (7,14,22,3,24) encrypted using key f (ie a shift of 5) is MTBID
22
Criptoanálise da Cifra de Cesar
Possui somente 26 cifras A pode ser mapeado para A,B,..Z Podemos simplesmente testar todas as chaves (ataque de força bruta) e reconhecer o plaintext. (díficil de estiver criptografado)
23
Criptoanálise da Cifra de Cesar
meet me after the toga party CARACTERÍSTICAS Algoritmo de criptografia e descriptografia são conhecidos Existem apenas 25 chaves a serem experimentadas A linguagem do plaintext é conhecida e facilmente reconhecida
24
Cifra de César Utilize a planilha Excel do site da cadeira para quebrar por força bruta as seguintes mensagens cifradas em César: TXFQ ZSTX IJXJ LZWF SHFJ RXNX YJRF XBJG XFTR ZNYT NSYJ QNLJ SYJX MLMD MUBQ ZIZV WBIA JWIA Utilize a planilha Excel do site da cadeira como base para construir um cifrador de Cesar. A planilha deverá receber o valor de k e o plaintext, gerando o ciphertext.
25
Cifras Monoalfabéticas
Ao invés de simplesmente utilizar ‘rotação’, as letras poderiam ser misturadas de modo aleatóro. Cada letra do plaintext é mapeada para uma letra aleatória definida dentro de uma permutação dos 26 caracteres. Chave possui tamanho de 26 caracteres Plain: abcdefghijklmnopqrstuvwxyz Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN Plaintext: ifwewishtoreplaceletters Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA With only 25 possible keys, the Caesar cipher is far from secure. A dramatic increase in the key space can be achieved by allowing an arbitrary substitution, where the translation alphabet can be any permutation of the 26 alphabetic characters. See example translation alphabet, and an encrypted message using it.
26
Segurança das cifras monoalfabéticas
total de 26! = 4 x 1026 chaves com tantas chaves, a cifra pode ser vista como segura. … mas está !!!ERRADO!!! O problema está na característica da linguagem.
27
Criptoanálise e redundância nas linguagens
Linguagem humana é redundante Letras não são iguamente utilizadas Existem tabelas para freqüências únicas, duplas e triplas para várias linguagens
28
Freqüência - Língua Inglesa
29
Criptoanálise - Desafio
mp oqpwjnp tbabcp jqfnpt fwokpqbq bkhvnbt uvkmfqbajkjcbcft cf tfhvqbmdb
30
Cifra de Playfair Nem mesmo um grande número de chaves em uma cifra monoalfabética oferece segurança A cifra Playfair criptografa mais de uma letra ao mesmo tempo
31
Matriz de chaves Uma matriz 5X5 de letras baseada em uma palavra chave
Colocar a palavra-chave(sem duplicação) Preencher o resto da matriz com outras letras M O N A R C H Y B D E F G I/J K L P Q S T U V W X Z
32
Criptografando Texto criptografado duas letras por vez:
Se um par é uma letra repetida, insira ‘X’ Se ambas as letras estão na mesma linha, troque cada uma pela letra da direita (fila circular) Se ambas as letras estão na mesma coluna, troque cada letra pela letra abaixo dela (fila circular) Se não, cada letra é trocada pela letra na mesma linha e coluna da outra letra do par. Plaintext is encrypted two letters at a time,according to the rules as shown. Note how you wrap from right side back to left, or from bottom back to top. if a pair is a repeated letter, insert a filler like 'X', eg. "balloon" encrypts as "ba lx lo on" if both letters fall in the same row, replace each with letter to right (wrapping back to start from end), eg. “ar" encrypts as "RM" if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg. “mu" encrypts to "CM" otherwise each letter is replaced by the one in its row in the column of the other letter of the pair, eg. “hs" encrypts to "BP", and “ea" to "IM" or "JM" (as desired) Decrypting of course works exactly in reverse. Can see this by working the example pairs shown, backwards.
33
Criptografando EDUARDOBASTOS KCXMDKAHBXPRXA M O N A R C H Y B D E F G
I/J K L P Q S T U V W X Z Plaintext is encrypted two letters at a time,according to the rules as shown. Note how you wrap from right side back to left, or from bottom back to top. if a pair is a repeated letter, insert a filler like 'X', eg. "balloon" encrypts as "ba lx lo on" if both letters fall in the same row, replace each with letter to right (wrapping back to start from end), eg. “ar" encrypts as "RM" if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg. “mu" encrypts to "CM" otherwise each letter is replaced by the one in its row in the column of the other letter of the pair, eg. “hs" encrypts to "BP", and “ea" to "IM" or "JM" (as desired) Decrypting of course works exactly in reverse. Can see this by working the example pairs shown, backwards. EDUARDOBASTOS KCXMDKAHBXPRXA
34
Segurança da cifra Playfair
Segurança maior do que os monoalfabéticos (26 x 26 = 676 digramas) Necessitará de 676 entradas na tabela de freqüência para analisar (versus 26 para uma cifra monoalfabética) Utilizada na 1a. Guerra Mundial eg. by US & British military in WW1 Pode ser quebrada, pois ainda mantém a estrutura do plaintext
35
Cifras de Transposição
Também chamadas de cifras de permutação Escondem a mensagem modificando a ordem das letras Sem alteração das letras reais utilizadas Pode ser reconhecida porque mantém a mesma distribuição de freqüência do texto original. All the techniques examined so far involve the substitution of a ciphertext symbol for a plaintext symbol. A very different kind of mapping is achieved by performing some sort of permutation on the plaintext letters. This technique is referred to as a transposition cipher, and form the second basic building block of ciphers. The core idea is to rearrange the order of basic units (letters/bytes/bits) without altering their actual values.
36
Cifras de transposição (rail fence)
Escrever as letras da mensagem na diagonal em um número de linhas e lê-la linha a linha. Ex (profundidade 2): m e m a t r h t g p r y e t e f e t e o a a t ciphertext MEMATRHTGPRYETEFETEOAAT
37
Mais complexidade… Transposição mais complexa
Escrever as letras da mensagem em linhas em um específico número de colunas Reordenar as colunas de acordo com a chave Mais de um estágio pode ser aplicado Key: Plaintext: a t t a c k p o s t p o n e d u n t i l t w o a m x y z Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
38
Cifras de Produto Cifras que utilizam substituições ou transposições não são seguras em função das características da linguagem Uso de várias cifras em seqüência tornam a tarefa mais complexa, mas: Duas substituições -> substituição mais complexa Duas transposições -> transposição mais complexa Substituição + Transposição -> Cifra de Produto ‘pulo’ para cifradores mais modernos e complexos (ex: DES)
39
Máquina de Rotor
40
Esteganografia uma alternativa a criptografia
esconde a existência da mensagem Utiliza somente um sub-conjunto das letras/palavras em uma mensagem maior marcada de algum modo Utiliza o LSB de um gráfico ou de um arquivo de som desvantagem Alto overhead para esconder poucos bits.
41
Cifradores Modernos DES/3DES
42
Data Encryption Standard (DES)
US standard 64 bit plain text blocks 56 bit key broken in 1998 by Electronic Frontier Foundation special purpose US$250,000 machine with detailed published description less than three days DES now worthless
43
DES
44
DES
45
Cifradores Modernos AES
46
Advanced Encryption Standard
NIST issued call for proposals for an Advanced Encryption Standard (AES) in 1997 security strength equal to or better than 3DES significantly improved efficiency symmetric block cipher with block length 128 bits key lengths 128, 192, and 256 bits evaluation include security, computational efficiency, memory requirements, hardware and software suitability, and flexibility AES issued as FIPS 197 in 2001
47
AES Description assume key length 128 bits
input a 128-bit block (square matrix of bytes) copied into state array, modified at each stage after final stage, state copied to output 128-bit key (square matrix of bytes) expanded into array of bit key schedule words byte ordering by column 1st 4 bytes of 128-bit input occupy 1st column 1st 4 bytes of expanded key occupy 1st column
48
AES Encryption and Decryption
49
AES Encryption Round
50
AES Demonstração applet Java AES
Apresentações semelhantes
© 2024 SlidePlayer.com.br Inc.
All rights reserved.