Symmetric Key Cryptography
Summary
TLDRThis script delves into the concept of block ciphers, a fundamental aspect of modern cryptography. It explains the evolution from historical ciphers to modern digital encryption, emphasizing the importance of encoding standards like UTF-8 over ASCII for comprehensive character representation. The speaker highlights the significance of block size in cipher security, advocating for a minimum of 128-bit keys for personal use and 256-bit for military applications. The script also introduces the principles of confusion and diffusion in cipher design, aiming to ensure that cipher text statistics are complex and that changes in plain text or key significantly affect the cipher text.
Takeaways
- đïž Block ciphers are an important topic in modern cryptography, which encrypt data in fixed-size blocks of bits instead of individual characters or pairs of characters.
- đ Historical ciphers were replaced due to their vulnerability to statistical techniques like frequency analysis, which is not a concern with block ciphers.
- đ Communication parties must agree on an encoding standard, such as UTF-8, to represent letters, numbers, and symbols as strings of bits for digital communication.
- đ The ASCII encoding standard is widely known but does not include some special characters used in languages like Turkish, leading to the preference for UTF-8.
- đą The number of bits used to represent characters is crucial; for instance, 8 bits allow for 256 different characters, which is why block sizes of 64 or 128 bits are common for encryption.
- đ Block ciphers provide confidentiality by transforming plaintext into ciphertext using a secret key, which is essential for secure communication over potentially insecure channels.
- đ Symmetric key encryption algorithms, including block ciphers, use the same key for both encryption and decryption, whereas asymmetric key algorithms use a public key for encryption and a private key for decryption.
- đ Block ciphers involve a permutation of the input space (plaintext blocks) to the output space (ciphertext blocks), creating a complex relationship that is difficult for cryptanalysts to exploit.
- đ The design of a good block cipher aims to provide confusion and diffusion, making it challenging to deduce any relationship between the ciphertext and the plaintext or the key.
- đ§ The security of a block cipher is not absolute and can be compromised if a cryptanalyst develops a new technique to exploit weaknesses in the cipher.
- đ The size of the key space (e.g., 2^128 for a 128-bit key) is vast, and a good block cipher should act as if it is a randomly selected permutation from this large set.
Q & A
What is the primary difference between historical ciphers and modern block ciphers?
-Historical ciphers typically operated on individual characters or pairs of characters, which could be easily broken using frequency analysis. In contrast, modern block ciphers operate on pairs of bytes or larger blocks of bits, making them much more secure against such attacks.
Why is encoding important in cryptography, especially in digital communication?
-Encoding is crucial because it ensures that both communicating parties agree on a common way to represent data, such as letters, numbers, and symbols, as a string of bits. This standardization is necessary for effective encryption and decryption.
What are the limitations of the ASCII encoding standard mentioned in the script?
-The ASCII encoding standard is limited because it only supports 128 characters, which is insufficient for languages with special characters, such as Turkish. This limitation can cause incorrect character representation in digital communication.
What is the significance of block size in block ciphers, and what are the commonly used block sizes?
-The block size in block ciphers is significant because it determines how much data is encrypted at a time. Commonly used block sizes are 64 or 128 bits, with 128 bits being preferred for stronger security. Smaller block sizes, like 32 bits, are less secure and more vulnerable to attacks.
What is the role of secret keys in symmetric key cryptography?
-In symmetric key cryptography, the same secret key is used for both encryption and decryption. The security of the system relies on keeping this key confidential, even if the encryption and decryption algorithms are known.
How do public key cryptography and symmetric key cryptography differ in terms of key usage?
-In symmetric key cryptography, both parties use the same secret key for encryption and decryption. In public key cryptography, one key (public key) is used for encryption, and a different key (private key) is used for decryption, with the private key being kept secret.
What is meant by confusion and diffusion in the context of block cipher design?
-Confusion refers to making the relationship between the cipher text and the key complex and non-linear, while diffusion involves spreading the influence of each bit of the plaintext and the key over many bits of the ciphertext to obscure statistical patterns.
Why is the choice of key size important in encryption, and what key sizes are recommended for different use cases?
-The key size is important because it determines the security level of the encryption. For personal use, a 128-bit key is recommended, while military applications typically require a 256-bit key for stronger security. A larger key size provides more protection against brute-force attacks.
How does block cipher encryption work at a high level?
-Block cipher encryption works by dividing the plaintext into fixed-size blocks (e.g., 128 bits) and encrypting each block separately using a secret key. This process creates ciphertext blocks, which together form the encrypted message.
What is the importance of selecting a good permutation in block cipher design?
-Selecting a good permutation is crucial because it ensures that the encryption process maps plaintext blocks to ciphertext blocks in a way that is secure and resistant to cryptanalysis. A good permutation makes it difficult to find any relationship between related keys or ciphertexts.
Outlines
đ Understanding Block Ciphers and Data Encoding
This paragraph introduces the concept of block ciphers in cryptography, explaining the need to encrypt pairs of bytes instead of single characters in the modern era. The discussion highlights the importance of data encoding standards like ASCII and UTF-8, emphasizing their role in representing characters as bits for digital communication. The paragraph also addresses historical issues with encoding, particularly how ASCII failed to represent special characters in languages like Turkish. The explanation extends to the basics of data representation using bits and bytes, leading to a discussion on how block ciphers handle large amounts of data, such as megabytes or terabytes, in encryption.
đ Symmetric and Asymmetric Encryption Algorithms
This paragraph delves into the different types of cryptographic algorithms, focusing on symmetric key encryption, such as block ciphers and stream ciphers, and public key encryption, like RSA. It introduces the concept of authenticated encryption algorithms that provide both confidentiality and data authentication. The discussion includes the roles of hash functions and digital signatures in ensuring data integrity and origin non-repudiation. The paragraph outlines the broad scope of cryptography, touching on advanced topics like post-quantum cryptography and full homomorphic encryption, which are part of the larger cryptographic landscape.
đ Defining Cryptosystems and Cipher Text
This paragraph defines key cryptographic terms, such as plaintext, ciphertext, and cryptosystems. It clarifies the distinction between the terms 'cipher' and 'password,' which are often confused in some languages. The explanation covers the process of converting plaintext into ciphertext using encryption algorithms and the importance of keeping the decryption key secure. It also emphasizes that while the encryption algorithm can be public, the security of the system relies on the secrecy of the key, in line with Kerckhoffs's principle.
đŠ How Block Ciphers Operate
This paragraph explains the operation of block ciphers, which encrypt fixed-size blocks of data using a secret key. It describes the importance of choosing an appropriate block size, such as 64 or 128 bits, to ensure security against attacks like frequency analysis. The discussion highlights how block ciphers map input blocks to output blocks through permutations, and the significance of designing a cipher that selects a secure subset of permutations. It introduces the concept of related-key attacks and stresses the need for different permutations when even a small change is made to the secret key.
đ Confusion and Diffusion in Cipher Design
This paragraph discusses the principles of confusion and diffusion, introduced by Claude Shannon, which are essential in designing secure block ciphers. Confusion makes the relationship between the plaintext, ciphertext, and key complex, preventing attackers from easily deducing the key. Diffusion ensures that a change in one part of the plaintext affects many parts of the ciphertext, making statistical attacks difficult. These abstract concepts are fundamental to creating effective cryptographic algorithms, although their security can't be definitively proven, only tested against known cryptanalysis techniques.
Mindmap
Keywords
đĄBlock Cipher
đĄEncoding
đĄASCII
đĄSymmetric Key Cryptography
đĄConfusion and Diffusion
đĄPermutation
đĄPublic Key Cryptography
đĄCiphertext
đĄMessage Authentication Code (MAC)
đĄKey Agreement Algorithm
Highlights
Introduction to block ciphers as a modern cryptographic technique to replace historical ciphers.
Explanation of the necessity to move from character pairs to bit pairs in encryption due to digital data handling.
The importance of agreeing on an encoding standard like UTF-8 for digital communication to avoid issues with character representation.
The limitations of ASCII encoding, particularly its inability to represent special characters in some languages like Turkish.
The concept of using bits to represent characters and the significance of the switch point at seven or eight bits for character representation.
The role of block ciphers in encrypting large amounts of data efficiently, such as one megabyte or even terabytes.
Cryptography's role in solving problems of confidentiality, authentication, and non-repudiation in digital communications.
Differentiation between symmetric key encryption algorithms like block and stream ciphers, and public key encryption algorithms like RSA.
The significance of choosing an appropriate block size in block ciphers to prevent vulnerability to frequency analysis.
The explanation of how block ciphers operate on fixed-size blocks of data, creating a permutation from input to output space.
The comparison of the vast number of possible permutations in block ciphers to the small subset actually used for encryption.
The importance of key size in block ciphers, with recommendations for different use cases, including personal and military standards.
The abstract concepts of confusion and diffusion in cipher design, introduced by Claude Shannon, to enhance security.
The definition of confusion as making the cipher text's relation to the key and plain text statistics complex for cryptanalysts.
The definition of diffusion as ensuring that changes in the plain text or key influence many bits in the cipher text.
The practical application of confusion and diffusion in the design of block ciphers to create a secure encryption method.
Transcripts
all right so today's topic is very
important which is called block ciphers
so we have seen the historical ciphers
so we understand why we need to replace
a pair of characters instead of a single
character right because it is easy to
break by using statistical techniques
like frequency analysis now uh we are in
the modern AG so instead of uh
encrypting pairs of characters we are
actually going to pairs of bites right
because we are dealing with zeros and
ones so first we have to agree on the
encoding okay in order to people or to
device to communicate they have to agree
in the language right so here encoding
is what we are going to tell it so
historical sers mostly operate on
letters since they are pen and paper
methods when working with digital data
we can represent letters number symbols
Etc a string of bits right thus the
communicating parties must first agree
on an
encoding this is why we have standards
right ask is the best known because it
is American Standard but generally we
prefer utf8 because ASI doesn't contain
the some of special Turkish characters
right so for this reason we cannot use
directly ask this is why years ago most
probably you remember whenever you chat
in a video game or in the general uh
chat program you could when you press a
Turkish character and send it you will
see a different symbol there this is
because of asky table okay they were
using asky okay so let me show you uh
the full ask key table so since we are
representing data as bits you know
Gathering bits together allows you to
represent more characters like because
with a single bit you can represent zero
or one so you can only represent two
character right you can say a is zero
and B is one and that's it but your
alphabet has more letters right so you
have to use
more uh bits so if you use two bits 2 to
the two is four so you can represent
four characters right so this way
actually if you look at the powers of
two you will realize that the switch
spot is something like seven or eight
because 2 to the 7 is
128 which is enough actually this part
of the table is 2 to the 7 which gives
you 128 characters
but if you add one more bit and make it
eight bits you can actually represent
two to
256 different characters right we are
starting from zero so this is why we end
up with
255
so first you have to agree on the
encoding and here as you can see uh
capital letters and then small letters
appear here we have the numbers and so
on and so forth at this extended part we
have have more Latin characters that are
used especially in French right but as
you can see we don't have some special
Turkish characters like sh or soft G
right this is why we cannot use it also
this picture shows explains one of the
problems when you see a list in a
Turkish web page or a database however
if your name starts with ch like
here and when you see a alphabetical
list you would expect to find your name
after C right but sometimes you don't
appear there the all alphabet ends with
the name Z and then you appear below it
this is because
128 is larger than these numbers okay
this is the whole reason they are using
asky table so CH comes a lot later than
Z this is the whole reason so this is
wrong database design if if you are
allowing Turkish characters then you
should be using a different encoding
this is the whole Li but here I'm only
talking this to say that we are going to
work on bits and we have a method to
represent every character in terms of
bits okay we agree on that then we will
talk about how we encrypt them okay
so in our case a single bite is 8 Bits
you know 1,24 by is 1 kiloby and so on
and so forth but uh we have very length
input in our cases for instance we are
going to encrypt maybe one megabyte or 2
terabytes we should have a method to do
that right block cers can do that this
is the whole idea
so let's remember where we are and then
we are going to talk about how block
ciphers work so as I mentioned before
cryptography solves a lot of problems
for the case of confidentiality which is
our current topic today we can provide
confidence confidentiality by encryption
algorithms like blog sers stream cers
these are symmetric key encryption
algorithms or you can use public
encryption algorithms like RSA or algama
which will'll be talking Weeks
Later nowadays we are we have
authenticated encryption algorithms
which provide both confidentiality but
also data
authentication also you can provide data
authentication with hash functions
message authentication codes moreover
you can obtain anti authentication with
digital signature zero knowledge proofs
or with digital signatures we also solve
the problem of origin non reputation so
this is actually the small picture of
all cryptography it doesn't contain
everything in order to talk about
everything in cryptography actually the
picture has to be a lot larger because a
lot of things are missing in this
picture like postquantum cryptography
full homomorphic full homomorphic
encryption multiparty computation
Randomness and so on and so forth so it
is a huge list and we are going to
actually cover almost everything that is
in this picture and some more
okay so let's talk about cryptographic
algorithms some algorithms use key and
some do not for instance cryptographic H
functions are keyless algorithms so you
don't have a secret information that is
shared between parties but for the case
of encryption we need keys so that
communic parties can agree right or for
also for message authentication and so
so we divide these key algorithms as
symmetric and asymmetric or secret key
and public key in the secret key case
secret key algorithms use the same key
material for both encryption and
decryption hence the name symmetric key
cryptography there are three types of
algorithms in this category blog ciphers
which is today's topic stream sers and
another way of encryption and message
authentication C this is not an
encryption algorithm as I mentioned this
is for data authentication okay here
you're not encrypting anything but you
are proving that the data didn't change
after you the person received okay so we
will see all of
them although these algorithms look very
different like log ciphers stream
ciphers they can actually uh in order to
understand one of them you have also
need to know the other so you cannot
simply learn block cers without learning
steam ciphers or hash functions and so
on so block ciphers and steam ciphers as
I mentioned are encryption Primitives
while the message authentication code is
used for data and data origin
authentication however as I mentioned
these topics are not completely
unrelated we can use a block CER to
build a b stream CER and the message
authentication code even we can turn a
block Cipher into a hash function
okay there are methods for that which
we'll be talking about when we talk
about HH functions a symmetri key crypto
system
part is uh relatively new compared to
symmetric key crypto systems because
symmetric key crypto systems actually
dates back to the invention of the you
know maybe the letters right but
asymmetric key cryptography thanks to Dy
Helman uh became famous around
1976 so there are different types of
algorithms here one of them is key
agreement algorithms like def key
exchange algorithm so this is important
because in key crypto systems we start
with the assumption that communicating
parties both securely shared the secret
key between each other right so they
need a secure channel to do that in the
key agreement algorithm we will do it on
an insecure Channel this is the nice
thing okay the whole internet actually
works with this principle okay okay and
imagine that you are adding a new device
to a network right so you initially want
to start communicating in an encrypted
way but you don't know other devices yet
so this is very very
important we have public encryption
algorithms like RSA or
ALG uh we have digital signature
algorithms like DSA which is digital
signature algorithm or standard DSS or
you can use the elliptic curve version
and you have ecdsa elliptic curve
digital signature algorithm which is
again very important and all Bitcoin or
cryptocurrency transactions are actually
elliptic C digital signature
okay so these are important
topics so let's remember the basic
definitions and terms we are going to
talk about the cipher or a crypto system
both are the same in my case but Cipher
is translated into Turkish in a wrong
way because whenever we say shifra which
is the Turkish translation of Cipher
actually people talk about
passwords okay here we are talking about
crypto systems this is
important so that mistake is actually
originating from maybe aund years ago
because whenever there's something
unknown people refer it to as shifra
Cipher but actually it is not so here
I'm going to talk about Cipher text in a
second we also call it the shif and so
so it is not in Turkish the there's a
confusion and I hope at one
point uh it will be corrected by
authorities okay so what is a crypto
system PL Tex is what you want to
protect so PL Tex can be an SMS message
a WhatsApp message a file in your
computer or your voice while you are
calling somebody and you're talking okay
so that is the plain text that is the
thing that you want to
protect a crypto system or a CER is just
a pair of algoritms that convert plain
text to Cipher text and back okay so a
cipher is not something that you can
press on your phone buttons and enter
that's is password okay this is cipher
so Cipher text is the encrypted version
of the plain text and Cipher text should
appear like a random sence so this is
the idea you have a plain text you want
to communicate or store that data but
you don't trust the medium that you are
using the communication Channel we
always assume that is insecure okay so I
need an
algorithm which we call encryption that
turns this plain text into Cipher text
which looks like just random zeros and
ones so in the communication Channel you
send this data and people receive that
every enemy or other people can listen
to this Communication channel and obtain
this but you still feel secure because
you know that if your algorithm is good
nobody can learn anything about the
plain text just by looking at the cipher
text okay but when you're the person you
want to communicate receive the cipher
text they have the decryption algorithm
and the secret key that they can decrypt
that is the whole idea
okay this is the nice thing so in the
symmetri key crypto systems you have a a
secret key and this is used for both
encryption and decryption sometimes you
use the identical key for encryption or
decryption sometimes you use in a
reverse order but important thing is
that encryption and decryption algorithm
are identical or closely related or if
we want a more scientific term we say
that one can be obtained from the other
in polinomial time okay in public key
cryptography this won't be the case Okay
because everybody will know the public
key and they will be allowed to encrypt
any message and sent to you but only you
have the private key where you can
decrypt it okay that's completely a
different scenario so symmetri case you
have to securely share this key between
parties before you want to communicate
maybe meet in person you know write it
into a paper and give it to them and so
but
uh however you do it we assume that the
both party have the secret key and also
this is the only thing that we keep
secret okay we don't care if the
algorithm is lost I mean if enemy knows
the this encryption and decryption
algorithm we don't care actually this is
casual principle saying that it should
be freely uh left to the uh enemy okay
we do we don't care as long as your
secret key is kept secure and secret
then enemy knowing everything about
about the algorithm shouldn't be a
problem and this is actually how modern
cryptography works because we have all
of these algorithms encryption and
decryption algorithms completely
detailed in the standard so you know how
the algorithm works it is not a secret
okay so how the block ciphers work block
ciphers operate on B bit blocks of data
so it is
fixed plain text is divided into b-bit
blocks each block is encrypted by secret
key K to produce B bit
output output blocks form the cipher
text so this is the whole idea instead
of working with a variable length data
you divide it into B bit blocks and then
work on
that th if you look at it in a
mathematical way a block Cipher and the
key you choose is actually a permutation
from 2 to the B elements to the two to
the B elements okay because you are your
input is bbits and you are mapping it to
to another bbits okay so you are
actually your input space is two to the
B output space is the same you are
mapping actual elements to each other so
this is just a
permutation nowadays we choose b as 64
or 128 depends actually on the use case
sometimes you can even choose as small
as 32 in some lightweight ciphers but if
you choose the block size as small as
that recall our historical ciphers we
said that you know replacing one bit
sorry one character with one character
didn't work due to frequency analysis
right so if you're choosing your bs32
bits divided by8 this means four bytes
right you are replacing four byes with
four bytes so as you can
imagine uh it is not that hard to attack
that kind of thing also you have to you
shouldn't be using that uh
Cipher for a very long time because
attacker May capture a lot of Cipher Tex
and pl Tex which actually covers the
whole Space so block size should be
large 64 is acceptable but generally we
use 128 so secret key size today we use
for instance Advanced encryption
standard allows three choices
128 this is for personal use so as a
individual person you shouldn't be
accepting any algorithm that has
security less than one 128 bits okay but
if you are military you should be using
256 bits and shouldn't accept anything
less
standard so you might ask what is the
point for 100 9 to2 nobody using it okay
so either choose this or CH choose that
you know I mean in libraries it is
implemented but nobody is using okay
even in papers when we obtain results
for all three cases we provide them in
the paper for 128 and 256 and put 192 K
in the appendix because of the page
limits okay so let's go back to our
initial claim I said that this is a
mapping from 2 to the B elements to the
two to the B element so this is just a
permutation so question is how many
permutations can you have and this
number is really huge you can have 2 to
the B factorial permutations mapping 2
to the B elements to the 2 to the B
elements and this number is really
really just imagine b equal to 128 right
2 to the power of 2 to the B is a huge
number so there are a huge number of
permutations but when you design a block
CER and when you choose a key you are
actually choosing a small sets from this
huge sets Okay so a block Cipher will
provide only a tiny fractional of all
these available permutations for typical
values of B and K namely 2 to the K so 2
to the
128 is a very small number compared to
two to the 2 to the
120 right so there are a huge number of
permutations in which looks like
Infinity a huge space so you're are
trying to design a cipher which actually
chooses a good subset of it for security
for any chosen key we expect a good
block Cipher to act like as if it is a
randomly selected permutation so encrypt
analysis this will make more
sense even more we expect no relation
between permutations that are obtained
by keys that are related
somehow we will return to this when we
are talking about related key Crypt
analysis but here the IDE is as follows
so you design the block Cipher you chose
a key so this key and the cipher
actually Maps two to the B elements to
the two to the B element right this is a
permutation if you make a small change
to your secret key maybe flipping the
rightmost bit let's say then it will
give you a completely different
permutation there shouldn't be a
relation between these two cases okay
that is the idea and if there is such a
relation then we can perform a related
key attack which breaks the system
okay so before moving on to uh examples
and see what kind of ciphers we have to
today we have to understand how we
design them or what makes a block
ciphers a good Cipher so there are some
abstract Concepts and there's not an
actually
a mathematical way to actually show that
this uh Cipher is good or not currently
what we are doing is when we design a
cipher we actually try to break it with
every non Crypt analysis techniques and
see if it is secure or not okay you
cannot prove that it is secure maybe one
year later somebody may come up with a
new crypto analysis technique and break
the
cipher so let's look at this abstract
Concepts K Channon is considered as the
father of information Theory and
contribut to the field of Crypt analysis
for USA defense during World War II his
Landmark paper communication theory of
secrecy systems introduced the t ideas
of confusion and diffusion for practical
Cipher design so we will be talking
about sboxes permutations and so on all
those come from these confusion and
diffusion ideas okay our aim is to
provide confusion and
diffusion confusion is defined by him as
follows to make the relation between the
simple statistics of the cipher text and
the simple description of the key a very
complex and invol
one and for the diffusion the
statistical structure of the plain text
which leads to its redundancy is
dissipated into long range statistics in
the
cryptogram so note that this concept
concepts of confusion and diffusion are
not measurable Concepts they're absolute
Concepts right they're abstract so must
try to give alternative definitions for
this so confusion the cipher T
statistics should depend on the plain T
statistics in a manner too complicated
to be exploited by the Crypt
analyst diffusion each digit of the pl
text and each digit of the secret key
should influence many digit of the cyer
text so these definitions are a lot
better or easier to understand let's say
because our aim is to you know map bbits
to bbits right so by confusion we are
trying to design it so that by looking
at the cipher text for instance last
bite of the cipher Tex this shouldn't
give you an idea about the last bite of
the pl text right you are causing a
confusion so you are
actually making some modifications like
substitutions so this try creates a
confusion but if you work on bytes for
instance then you'll be working on
individual B right diffusion says that
if you make a small change of one part
of the cipher like one bit it should
affect as many bits as possible so this
is the whole idea
actually uh in terms of mathematics when
we assume that you have a plain text and
we encrypted and obtain a cipher text so
if you flip one bit of the plain text we
actually expect half of the cipher text
bits to be changed this is the actually
uh how we Define it
okay
5.0 / 5 (0 votes)