Git Product home page Git Product logo

Comments (3)

lvh avatar lvh commented on August 23, 2024

Why does block size determine number of possible blocks?

A block cipher is a (pure) function. If your block size is 4 bits, there are only 16 different blocks you could feed to it. From the rest of your comment I'm inferring you're thinking of how to chop up a message into blocks; but we're still dealing with the block cipher, and hence individual blocks, here.

Perhaps another key piece of information: there is no fundamental difference between "ciphertext" and "plaintext" blocks. A block cipher is just a pseudorandom permutation: it maps blocks to blocks. Hopefully this helps with understanding cycles.

To me this sounds like block of plaintext is identical to a block of ciphertext.

That is precisely what it means :)

from book.

megafinz avatar megafinz commented on August 23, 2024

If your block size is 4 bits, there are only 16 different blocks you could feed to it.

What is exactly a block? Is it like a piece of the input/output of a certain size or something else? And by "blocks" here you mean individual instances of blocks (like assume if input is a string "Hello World!" then blocks could be for example 3-char substrings like "Hel", "lo ", "Wor", "ld!")? Or is it different kinds of blocks of varying sizes, where size is expressed by 4-bit number and thus there could be 16 different sizes (like a 1-char wide block, 2-char wide block, …, 16-char wide block)?

A block cipher is just a pseudorandom permutation: it maps blocks to blocks. Hopefully this helps with understanding cycles.

No, not really. To my understanding a permutation is a rearrangement of items in a set. Like if we have a set [A1, A2, A3] and then we apply some shuffling logic to it and get [A2, A1, A3] in return.


I still didn't look up any alternative sources of information so I think this is a good opportunity to understand how people with little prior crypto knowledge approach the reading of this book :)

from book.

lvh avatar lvh commented on August 23, 2024

Yes, a block is an input or output to a block cipher. The block width is a property of that block cipher; you can't give the same block cipher e.g. a 2 char block and a 16-char block. That comes into play once you build a stream cipher out of your block cipher, in the form of padding: but you haven't gotten there yet. As the book says:

A block cipher is an algorithm that encrypts blocks of a fixed length.

Plaintext and ciphertext blocks are sequences of bits and always match in size. The block cipherʼs block size is a fixed
size. Keyspace is the set of all possible keys.

Re: permutation: yes, that is exactly what a block cipher is! Specifically, it's an efficient way to compute a permutation (it needs to be efficient because real block ciphers have large, e.g. 128-bit, block widths). As the book says:

A block cipher is a keyed permutation. It is a permutation because the block cipher maps each possible block to another block. It is also a keyed permutation because the key determines exactly which blocks map to which. It is important for the block cipher to be a permutation because the recipient must map blocks back to the original blocks.

from book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.