Entendendo a criptografia / Understanding cryptography [Part 4]

in #technology6 years ago

English version below

PT

Esta é a parte 4 da série de criptografia. Se você não viu as partes anteriores veja abaixo:


Source

O que vimos até aqui

Recapitulando o que já vimos antes, para usarmos criptografia precisamos de um algoritmo criptográfico. Este algoritmo tem de ser forte, ou seja, difícil de prever seus resultados ou reverter uma operação através de uma técnica de criptoanálise.

Também vimos que o algoritmo normalmente é público, e o que garante a segurança é a senha. Aqui você pode se perguntar, como pode ser seguro se é público? Eu explico. O algoritmo nada mais é do que uma sequencia de diversas operações como as de substituição e transposição que vimos no texto anterior. O que o torna seguro é quando acrescentamos a chave, que é única e a cada chave usada um resultado completamente diferente é encontrado. Como existem milhões ou até bilhões de possibilidades se torna impossível prever o resultado tentando todas as possibilidades, isso é o que o torna seguro.

Sobre a chave, também chegamos a conclusão de que para a criptografia funcionar, ela deve ser conhecida apenas pela origem e pelo destino, e ser encaminhada entre as partes por um canal seguro.

Para complementar os conceitos que vimos nos textos anteriores vamos ver mais alguns.

security-2168233_1920.jpg
Source

Criptoanálise

Nos textos anteriores foi comentado superficialmente sobre criptoanálise, agora chegou a hora de entrar um pouco mais nesse assunto.

Como já conhecemos o algoritmo, o objetivo da criptoanálise é verificar se através de alguma falha do algoritmo pode-se recuperar a chave usada para cifrar um determinado texto. Podemos também obter a chave se o algoritmo for fraco. Isso quer dizer, se o algoritmo for previsível na sua saída padrão é possível reverter a operação sem usar a chave.

Os dois métodos mais comuns de obter esses dados é a análise do algoritmo e amostras de textos, e a força bruta.

No lado da análise, o atacante vai estudar o algoritmo, amostras de entrada e saída e com isso tentar forçar uma entrada específica que cause um bug ou tentar prever a entrada com amostras de saída.

No outro lado temos a força bruta. Como o nome sugere, esse tipo de ataque consiste em tentar todas as possibilidades até obter um texto legível. Em muitos casos essa é considerada uma opção desesperada, porque se o algoritmo for forte e a chave usada tiver um tamanho razoável, esse processo pode demorar centenas, milhares ou até milhões de anos.

Não acredita? Vamos a um exemplo!

Imagine que você tem um supercomputador e deseja testar todas as possibilidades de um algoritmo moderno e forte, como por exemplo o AES-256. O seu supercomputador pode testar 2 quintilhões de senhas por segundo. Isso é coisa para caceta! Um computador normal com uma boa GPU pode chegar até 2 bilhões de combinações por segundo para você ter uma comparação, é muito processamento.

supercomputer-1782179_1920.jpg
Source

Agora, quanto tempo esse supercomputador levaria para testar todas as possibilidades? De acordo com pesquisas e testes feitos por alguns matemáticos, seria necessário cerca de 9.17x10^50 anos para testar tudo. Para usar como comparação saiba que a idade do universo 1.4x10^10 anos. Outra coisa que você iria precisar era cerca de 150 reatores nucleares para manter os 150.000.000.000 watts de energia. Claro que a tecnologia evolui muito rápido e esse número tende a cair rápido, mas ainda assim é muita coisa.

Acho que este exemplo é suficiente para demonstrar a complexidade de quebrar ou prever as possibilidades de um algoritmo atual. :)

Obviamente se você rodar um ataque de fora bruta você vai conseguir quebrar uma chave específica em menos da metade desse tempo, talvez até muito menos se levarmos em conta senhas simples como 1234, password, teste, como os usuários gostam de colocar. Mas ai entra em outro assunto. Um dia escrevo sobre técnicas de quebra de senhas.

hacker-3342696_1920.jpg
Source

Então, com base nesses exemplos e conceitos, vamos seguir em frente. Podemos classificar a força dos criptossistemas de dois modos, computacionalmente seguros e incondicionalmente seguros.

Os algoritmos computacionalmente seguros são aqueles onde o custo para quebrar é superior ao valor das informações que podem ser obtidas. De nada adianta você ganhar 100 mil por uma informação que você gastou 1 milhão para obter. Também entra na categoria computacionalmente seguro quando o tempo é superior ao tempo de vida da informação cifrada. De quê adiantaria levar 100 anos para quebrar uma informação que automaticamente se tornar publica em 50 anos?

Outra categoria que temos é os algoritmos incondicionalmente seguros, neste caso, independente da quantidade de texto, tempo e recurso é impossível reverter a operação e determinar o texto claro.

ls

ENG

This is the fourth part of the cryptography series. If you have not seen the previous parts see below:


Source

What we've seen so far

To recapitulate what we have seen before, to use cryptography we need a cryptographic algorithm. This algorithm has to be strong, that is, difficult to predict its results or to reverse an operation through a cryptanalysis technique.

We have also seen that the algorithm is usually public, and what it secure is the password. Here you may ask yourself, how can it be safe if it is public? I explain. The algorithm is nothing more than a sequence of several operations such as substitution and transposition that we saw in the previous text. What makes it secure is when we add the key, which is unique and with each key used a completely different result is found. As there are millions or even billions of possibilities it becomes impossible to predict the outcome by trying all possibilities, that is what makes it safe.

On the key, we also concluded that for encryption to work, it should be known only by source and destination, and be routed between the parties via a secure channel.

To complement the concepts we have seen in the previous texts we will see some more.

security-2168233_1920.jpg
Source

Cryptanalysis

In the previous texts it was commented superficially on cryptanalysis, now the time has come to enter a little more on this subject.

As we already know the algorithm, the objective of cryptanalysis is to verify if through some fault of the algorithm one can recover the key used to encrypt a certain text. We can also get the key if the algorithm is weak. That is to say, if the algorithm is predictable in its standard output it is possible to reverse the operation without using the key.

The two most common methods of obtaining this data are algorithm analysis with text samples, and brute force.

On the analysis side, the attacker will study the algorithm, input and output samples and thus try to force a specific input that causes a bug or attempts to predict input with output samples.

On the other side we have the brute force. As the name suggests, this type of attack consists of trying every possibility until you get a readable text. In many cases this is considered a desperate option because if the algorithm is strong and the key used is a reasonable size, it can take hundreds, thousands or even millions of years.

Do not believe? Let's take an example!

Imagine that you have a supercomputer and want to test all the possibilities of a modern and strong algorithm, such as the AES-256. Your supercomputer can test 2 quintiles of passwords per second. This is huge! A regular computer with a good GPU can reach up to 2 billion combinations per second for you to have a comparison, it's a lot of processing.

supercomputer-1782179_1920.jpg
Source

Now, how long would this supercomputer take to test all the possibilities? According to research and tests done by some mathematicians, it would take about 9.17x10 ^ 50 years to test everything. To use as comparison know that the age of the universe is 1.4x10 ^ 10 years. Another thing you would need was about 150 nuclear reactors to keep the 150,000,000,000 watts of power. Of course technology evolves very fast and that number tends to fall fast, but it's still a lot.

I think this example is enough to demonstrate the complexity of breaking or predicting the possibilities of a current algorithm. :)

Obviously if you run a brute force attack you will be able to break a specific key in less than half that time, maybe even less if you take into account simple passwords like 1234, password, test, as users like to put. But here comes another matter. One day I write about password-breaking techniques.

hacker-3342696_1920.jpg
Source

So, based on these examples and concepts, let's move on. We can classify the strength of cryptosystems in two ways, computationally safe and unconditionally secure.

Computational safe algorithms are those where the cost to break is higher than the value of the information that can be obtained. It's no use you earning $ 100,000 for information you spent $ 1 million to get. It also enters the computationally safe category when time is higher than the lifetime of the encrypted information. What good would it take 100 years to break information that automatically became public in 50 years?

Another category we have is unconditionally secure algorithms, in this case, regardless of the amount of text, time and resource is impossible to reverse the operation and determine the clear text.

ls

InfosecBeerCrypto
LifeProductivity

Gosta dos meus posts? Quer apoiar? Upvote e siga! @deividluchi
Like my posts? Want to support? Upvote and follow! @deividluchi

Sort:  

Congratulations @deividluchi! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Semi Finals - Day 1


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


You can upvote this notification to to help all Steemit users. Learn why here!

Coin Marketplace

STEEM 0.27
TRX 0.11
JST 0.030
BTC 68918.37
ETH 3764.25
USDT 1.00
SBD 3.43