In this lesson,
we're going to cover cryptographic attacks.
Now, cryptographic attacks
refer to techniques and strategies that adversaries employ
to exploit vulnerabilities in cryptographic systems
with the intent to compromise the confidentiality,
integrity, and authenticity of your data.
These attacks are there
to defeat the cryptographic protections,
either by deciphering encrypted data
without the appropriate key, impersonating another user,
or creating forgeries that cryptographic systems
would deem authentic.
These methods can range from exploiting weaknesses
in cryptographic algorithms and protocols
to leveraging flaws in software implementations
or simply using brute-force techniques to guess the key.
For our purposes in this lesson, though,
we're going to focus on attacks related to downgrade attacks,
collision attacks, and the threat of quantum computing
that is looming over
all of our existing encryption algorithms.
Now, first we have downgrade attacks.
At its core, a cryptographic downgrade attack,
also known as a version rollback attack,
will aim to force a system to use a weaker
or older cryptographic standard or protocol
than what it's currently using.
The idea here is that by rolling back
to these outdated versions,
an attacker can exploit known vulnerabilities or weaknesses
in those older protocols that have now been addressed
in newer or more secure versions.
For example, let's pretend
that we have two people, Alice and Bob,
and they want to establish a secure connection channel
between their systems.
Now, most modern cryptographic systems
will support multiple versions of a protocol
to ensure for backwards compatibility
with older legacy systems.
When Alice and Bob begin their handshake
to establish that secure connection,
their systems will typically communicate
the version of the protocols
that each one of them can support,
and then their systems will agree
to use the most secure version
that both of these systems can understand.
For example, if I speak English and Spanish
and you speak Spanish and Chinese,
we would agree to speak Spanish
because both of us understand that language.
So going back to our example,
let's pretend that we have an attacker named Eve,
and she wants to be able to intercept this communication
between Alice and Bob.
To execute this attack,
Eve will try to manipulate the messages being sent
between Alice and Bob's computer to establish this handshake
and decide on a version to use.
This way, they can manipulate the message
to say the highest version that both parties support
is in fact an older, less secure version.
Now, Alice and Bobs' systems, unaware of Eve's interference,
will proceed with the outdated protocol,
and this makes all their communications susceptible
to vulnerabilities inherent in that older version
of the encryption algorithm
that Eve can now take advantage of
to be able to see everything they're sending back and forth.
One infamous real-world example
of this type of downgrade attack
involves the use of the POODLE attack,
known as the Padding Oracle
On Downgraded Legacy Encryption attack,
which targeted SSL version 3.0.
Now, despite the availability
and widespread use of a more secure protocol like TLS,
many systems still supported SSL 3.0
for backward compatibility.
POODLE tried to exploit this by forcing its victims
to revert to this older, more insecure protocol,
and this would allow attackers
to extract sensitive data from these communications.
So, why are downgrade attacks so dangerous?
Well, these downgrade attacks are dangerous
because they turn the very nature of evolving security,
such as the development of a stronger,
more robust cryptographic protocol, against itself.
In trying to be more inclusive and comprehensive,
our systems that maintain this backwards compatibility
with older standards are unknowingly leaving themselves open
to these types of downgrade attacks.
But it's not all doom and gloom.
Awareness of downgrade attacks
has led to the development of countermeasures
to help prevent them.
For instance, many systems have phased out support
for legacy protocols that are known to be truly insecure,
even if it means sacrificing backward compatibility.
In other scenarios, version intolerance checks
can also be employed where a system tests the waters
by initially claiming to only support
the most recent protocol version.
If the other end user
truly doesn't support the latest version,
they will naturally respond accordingly,
but if there's any interference forcing a downgrade,
this will quickly become apparent.
Second, we have collision attacks.
Now, a collision attack aims to find two different inputs
that produce the same hash output.
This can be a vulnerability
because hashing is commonly used for data verification.
For example, when you're downloading a file
from the internet, the website may provide a hash value
for that file.
Once you finish downloading the file,
you can run it through a hash algorithm
and calculate a new hash digest.
Then you compare that
to the one that's listed on the website.
If they match, it's assumed that the file
has not been tampered with.
However, if an attacker can produce a malicious file
with the same hash value by exploiting a collision,
the user could be tricked into thinking
they have a legitimate file
when in fact they have a file that has the same hash value,
which means it's subject to a collision.
Historically, MD5, also known as Message Digest Algorithm 5,
was a popular hashing function.
However, over the years,
many vulnerabilities in its structure
made collision attacks much more feasible.
Cybersecurity researchers were eventually able
to create two different sequences
that hashed out to the same MD5 hash,
rendering MD5 unsuitable for further use
in security certificates and encryption technologies.
These collisions do undermine the trust
and reliability placed on cryptographic tools,
and they could potentially allow malicious actors
to impersonate trusted entities, forge digital signatures,
or distribute tampered data while appearing genuine.
Now, the "Birthday Paradox" or "Birthday Attack"
is a counterintuitive probability theory
that plays a significant role
in understanding collision attacks.
The paradox itself posits that in a group of just 23 people,
there's a better than even chance
that two of them share the same birthday.
Translating this to cryptography,
the "Birthday Attack" refers to the probability
that two distinct inputs or files,
when processed through the same hashing function,
will produce the same output, which we call a collision.
Due to this principle,
finding collisions in a hashing function
might be more probable than initially perceived.
For cryptographic systems,
especially hashing algorithms with a fixed size output,
like MD5, SHA-1, SHA-256, and SHA-3,
this means that vulnerabilities to collisions
might arise faster than expected,
and this underscores the necessity
for robust cryptographic designs
and frequent algorithm updates.
Third, we need to talk about quantum computing
and the threat it poses
to our current cryptographic implementations and algorithms.
Before we dive into the threat of quantum computing,
we need to take a moment to define it.
Now, quantum computing involves a computer
that uses quantum mechanics
to generate and manipulate quantum bits, known as qubits,
in order to access enormous processing power.
Now, I know this is a weird definition
because in the definition itself,
I'm using two terms inside of it,
both quantum and computing.
And in this case, I really don't like that definition,
but there really is no better way to explain this.
Now, when you think about a classic computer
like the one you're watching this course on right now,
it's using ones and zeros to process information.
The faster you can flip those bits
and turn a one to a zero, or a zero to a one,
that means the faster you can get information done
and the faster computer you have overall.
Well, at a certain point,
we can't make our computers any faster
by simply flipping bits.
This means we've run out of computing capability.
So to overcome that, we started taking single processors
and putting in dual processors.
And then we made quad processors, which had four cores,
and then we made octa-core processors that had eight cores,
and things like that as we kept speeding up our computers.
Well, with quantum computing,
it is a completely different ball game.
Instead of using ones and zeros,
we use things known as quantum bits, or qubits,
and this can be done in computing or in communications.
Now, when we deal with communications,
we're talking about quantum communications
being a communications network
that relies on using qubits made of photons,
or in our case, light,
to send multiple combinations
of ones and zeros simultaneously,
which will result in tamper-resistant
and extremely fast communications.
Again, I know this is really vague,
but hang in with me here for just a second.
When we talk about quantum,
I keep talking about these things called qubits,
and I talk about the fact that there's a difference
between our traditional electrons,
which are either on or off, ones or zeros,
and this thing called a qubit.
So let's talk about a qubit for a moment.
What exactly is it?
Well, a qubit is really just a quantum bit.
It's composed of either electrons or photons,
so it can either be electrical or made by light,
and it can represent numerous combinations of ones and zeros
at the same time using something known as superpositioning.
Now, this is really the main benefit
of using a quantum computer over a traditional computer
because we're not just going to have a single one or zero.
You can have multiple combinations of ones or zeros
at the same time, and this would all be one qubit.
So you can actually crunch through
a wide variety of potential outcomes simultaneously.
And so it's really great when you're trying to do a bunch
of really complex math problems,
and that's really the whole reason
that we have quantum computing.
When you think about quantum computing,
it's never going to replace the computer on your desktop.
That is not what it's designed for.
Instead, it's designed for very specific use cases,
such as very complex math problems
or trying to do something like modeling of an atom
or some kind of atomic structure, or something like that.
Now, why should I care about quantum
if it's never going to be something
that's sitting on my desktop?
Well, because there's one thing that quantum
is really, really good at.
And what is that? It's math problems.
And if you think about cryptography, all cryptography is
is a bunch of really complex math problems.
And so because cryptography is used
to secure our communications and our data
by relying on how difficult a math problem is to compute,
with a traditional computer, this is actually something
that gives us strength in cryptography.
But if quantum computers are really good
at doing math problems,
and they can do it much, much faster,
that means our cryptography can actually be defeated
and taken down by a quantum computer.
And this is why we have to start thinking about this,
because it's one of the things
we rely so heavily on in cryptography is the key exchange
using asymmetric communications.
Now, one way we do that
is with the public key infrastructure.
Well, that whole concept is that we have to have a way
to do a simple math problem to create a very complex thing
that has a difficult time of being broken back apart.
So for example, if I take two prime numbers
and I multiply them together and I give you the result,
that result is really easy to calculate
if you know what the two prime numbers are
to be able to multiply them together.
This would be, in our case, a public and private key
that really represent two really large prime numbers.
Now, once you have that result, though,
it might be a really large number,
but there's only two things that can be factored into it,
those two keys, the public and private key
that I just gave you.
Those are our two prime numbers.
Well, with quantum computing,
they can make very quick work of this type of math problem,
whereas our traditional computers can't
because it'd involve taking that big number
and dividing it by one and then dividing by two
and then dividing by three
and then dividing by five, then dividing by seven,
and keep going until we get all the prime numbers
and find the two factors.
Well, with quantum computing,
we don't have to do it that way.
Instead, this becomes a relatively easy math problem,
and we can crack it much, much quicker
with a quantum computer.
In fact, asymmetric encryption algorithms,
which are those that rely on this hard math problem,
have been mathematically proven
to be broken by quantum computers.
Now, the good news here
is that at the time of me saying this,
there are no real operational quantum computers in use.
In fact, the only quantum computers
at the time of me saying this
are ones being used for prototyping and development
on a very small scale,
and governments and large companies
are the ones who are spending enormous sums of money
to create these small-scale quantum computers.
Right now, the estimate
is that we won't have a working quantum computer
until at least 2030 for government and large corporate use.
But consumers like you and I
won't see quantum computers available
until sometime in the late 2030s or early 2040s.
But it is something we need to be aware of
because our current encryption algorithms
are not made to withstand the power of quantum computing.
So, that brings us to this idea
of how do you overcome quantum computers
when you're dealing with cryptography?
And that is post-quantum cryptography.
Now, post-quantum cryptography
is a new kind of cryptographic algorithm
that can be implemented using today's classic computers
but would still be impervious to attacks
from future quantum computers
once they're in production and they are widely available.
Now, there's really two methods that we use
to try to create this post-quantum cryptography world.
The first method is to just increase our key size
and to increase the number of permutations that are needed
to be brute-forced.
This works well when you're dealing
with symmetric encryption algorithms like AES.
If I take AES-128
and I increase it to AES-256, for example,
I have doubled my key length from 128 bits to 256 bits.
But I have actually squared
the number of possible combinations
that are going to have to be figured out
by that quantum computer, and this extends the time
and makes it much stronger and harder to crack.
The other way we do this is by working on other approaches,
and researchers are doing that right now.
These are called post-quantum resistant algorithms.
Now, these things are going to be looking at using things
like lattice-based cryptography
and supersingular isogeny key exchanges.
Now again, both of these terms
are not something you need to understand
or go in depth on.
In fact, when we talk about quantum computing
and quantum communications,
we really need to think about qubits
and all the stuff we're talking about with the word quantum.
And I just want you to associate this
with something that can be really easy to break apart
our asymmetric encryption algorithms pretty quickly
once it's in production, but it doesn't exist today yet.
Remember, asymmetric encryption algorithms
are the things that we use for key exchanges
and digital signatures in a public key infrastructure,
and that's really where the threat is
when we start talking about quantum computers.
Again, right now, we do not have
any dedicated quantum resistant cryptography yet,
but in 2022,
the National Institute of Science and Technology
did complete a six-year competition
to select post-quantum cryptographic standards,
and they ended up selecting four viable algorithms.
For your general encryption needs,
NIST recommends that you use the CRYSTALS-Kyber algorithm,
which uses a relatively small encryption key
and is focused on the difficulty of solving learning
with error problems over modular lattices
to provide a post-quantum encryption algorithm
that is roughly equivalent
to the strength of our current AES 256-based algorithms
used in symmetric encryption.
For digital signatures,
NIST recommends you select one of three algorithms,
either the CRYSTALS-Dilithium, FALCON, or SPHINCS+,
although NIST does recommend CRYSTALS-Dilithium
as the primary post-quantum digital signature algorithm.
All these algorithms do focus on the difficulty
of solving structured lattices except for SPHINCS+,
which instead focuses on the use of hashing functions.
So remember, when it comes to cryptographic attacks,
there are three main types that you need to consider.
These are downgrade attacks, collision attacks,
and the threat of quantum computing.
A cryptographic downgrade attack is used
to force a system into using a weaker
or older cryptographic standard or protocol
than what it's currently using.
A collision attack is going to be used
to find two different inputs
that produce the same hash output
by using the principles demonstrated
by the Birthday Paradox.
Quantum computing, on the other hand,
is more at the theoretical stage today
than the practical stage,
and it harnesses the principles of quantum mechanics
to process vast amounts of information simultaneously
in order to enable it
to potentially break traditional encryption algorithms
like RSA and ECC in just a few seconds
by rapidly factoring large prime numbers
or solving discreet logarithmic problems.
Since this capability threatens the foundational security
of our current digital communication
and data storage systems,
it is one that you should continually read up on
and study over the next few years
as quantum computing and post-quantum algorithms
begin to become a larger part
of our enterprise systems and networks.