Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First draft after proof-reading #412

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dg-latacora
Copy link
Contributor

I still need to read over this one more time

secure cryptosystems.

Mallory wants to figure out what Alice's record says. For simplicity's
sake, let's say there's only one ciphertext block. That means Alice's
sake, lets say there is only one ciphertext block. This means Alice's
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original let's say appears correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

wouldn't be encrypted using the same key.
Lessons learned: do not let IVs be predictable. Also, do not roll your own
cryptosystems. In a secure system, records of Alice and Mallory probably
are not encrypted using the same key.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this is a little funky. Let's replace

Also, do not roll your own cryptosystems. In a secure system, records of Alice and Mallory probably are not encrypted using the same key.

As we'll see later on in the book, just having unpredictable IVs doesn't make a system safe! This is a general argument against rolling your own cryptosystems: a high-quality implementation might have encrypted those records under different keys. Or it could use other controls, like relying on the associated data of an AEAD (which we'll see later) to make sure processes wouldn't perform cryptographic operations on behalf of Mallory that would also have worked for Alice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is great. I will make the changes

I have a question on original wording.

In " In a secure system, records of Alice and Mallory probably are not encrypted using the same key.", is there any "secure" system that encrypts different entities with a same key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

unpredictable because it's secret: if it were predictable, the attacker
could just predict the key directly and already have won. Conveniently,
many block ciphers have block sizes that are the same length or less
Many CBC systems set the key as the :term:`initialization vector`. This seems like
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many -> Some

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

could just predict the key directly and already have won. Conveniently,
many block ciphers have block sizes that are the same length or less
Many CBC systems set the key as the :term:`initialization vector`. This seems like
a good idea as you always need a shared secret key. It
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"as" feels weird here: "because" maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Many CBC systems set the key as the :term:`initialization vector`. This seems like
a good idea as you always need a shared secret key. It
yields a nice performance benefit because the sender and receiver
do not have to communicate to the IV explicitly. They already know the key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to communicate to the IV" makes no sense; the IV is the object of the communication.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing from

It yields a nice performance benefit because the sender and receiver do not have to communicate to the IV explicitly.

to

It yields a nice performance benefit because the sender and receiver do not have to exchange the IV explicitly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

than the key size, so the key is big enough.

This setup is completely insecure. If Alice sends a message to Bob,
The setup is completely insecure. If Alice sends a message to Bob,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again original reads better to me, how about you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a native Korean speaker, it is really difficult dealing with an article (in grammar sense). Korean doesn't have articles.

Long story short, reverted :)

do not have to communicate to the IV explicitly. They already know the key
(and therefore the IV) ahead of time. Plus, the key is an
unpredictable secret. If it was predictable, the attacker
can predict the key directly and already win. Conveniently,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... could just predict the key directly."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Lesson learned: do not use the key as an IV. Part of the fallacy in the
introduction is assuming secret data can be in the IV given
it only has to be unpredictable. This is not true: “secret” is
just a different requirement from “not secret”. It does not mean a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"It does not mean a stronger one" makes no sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a seoncd "Lesson learned" for attack on CBC mode.

I think this whole paragraph can be reworked a bit. Maybe this can be shortened and just reiterate the importance of picking random, unpredictable IVs.

And add in a general good guide on how to generate random, unpredictable IVs? (I don't know giving a guide is a thing for this book though)

what you're doing.
Plenty of systems exist where it is okay to use a secret when not
required. In some cases you may get a stronger system.
Though it depends on what you are doing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this new paragraph is overall worse than the original IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

secure cryptosystems.

Mallory wants to figure out what Alice's record says. For simplicity's
sake, let's say there's only one ciphertext block. That means Alice's
sake, lets say there is only one ciphertext block. This means Alice's
ciphertext consists of an IV and one ciphertext block.

Mallory can still try to use the application as a normal user, meaning
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lvh ,
Line 356 ends with "or ..."
Should this be updated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's intentional, but you could certainly just replace that with a ..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it as the original version.

wouldn't be encrypted using the same key.
Lessons learned: do not let IVs be predictable. Also, do not roll your own
cryptosystems. In a secure system, records of Alice and Mallory probably
are not encrypted using the same key.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is great. I will make the changes

I have a question on original wording.

In " In a secure system, records of Alice and Mallory probably are not encrypted using the same key.", is there any "secure" system that encrypts different entities with a same key?

unpredictable because it's secret: if it were predictable, the attacker
could just predict the key directly and already have won. Conveniently,
many block ciphers have block sizes that are the same length or less
Many CBC systems set the key as the :term:`initialization vector`. This seems like
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

could just predict the key directly and already have won. Conveniently,
many block ciphers have block sizes that are the same length or less
Many CBC systems set the key as the :term:`initialization vector`. This seems like
a good idea as you always need a shared secret key. It
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Many CBC systems set the key as the :term:`initialization vector`. This seems like
a good idea as you always need a shared secret key. It
yields a nice performance benefit because the sender and receiver
do not have to communicate to the IV explicitly. They already know the key
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing from

It yields a nice performance benefit because the sender and receiver do not have to communicate to the IV explicitly.

to

It yields a nice performance benefit because the sender and receiver do not have to exchange the IV explicitly.

do not have to communicate to the IV explicitly. They already know the key
(and therefore the IV) ahead of time. Plus, the key is an
unpredictable secret. If it was predictable, the attacker
can predict the key directly and already win. Conveniently,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

than the key size, so the key is big enough.

This setup is completely insecure. If Alice sends a message to Bob,
The setup is completely insecure. If Alice sends a message to Bob,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a native Korean speaker, it is really difficult dealing with an article (in grammar sense). Korean doesn't have articles.

Long story short, reverted :)

wouldn't be encrypted using the same key.
Lessons learned: do not let IVs be predictable. Also, do not roll your own
cryptosystems. In a secure system, records of Alice and Mallory probably
are not encrypted using the same key.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

what you're doing.
Plenty of systems exist where it is okay to use a secret when not
required. In some cases you may get a stronger system.
Though it depends on what you are doing.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants