Cipher Block Chaining - How do you change the plaintext of all blocks?A simple block cipher based on the SHA-256 hash functionWhy, or when, to use an Initialization Vector?Precisely how does CBC mode use the initialization vector?Understanding generation of IV in CBC encryptionHow can you change this message which is in block cipher AES-256 in CBC?Cipher Feedback Mode - sizes of the blocks and shift registersCan blocks in AES-CBC ciphertext be manipulated in such a way that plaintext becomes shuffled?Cipher Block Chaining Ciphertext AlterationHow to change the known ciphertext so the known plaintext is changed in AES CBC mode?Signal Protocol Header key encryption initialization vector

Binary Search in C++17

What does this symbol on the box of power supply mean?

A steel cutting sword?

Cipher Block Chaining - How do you change the plaintext of all blocks?

If a person had control of every single cell of their body, would they be able to transform into another creature?

Writing with dry erase marker on Shabbos, is it permitted?

Is it rude to call a professor by their last name with no prefix in a non-academic setting?

In general, would I need to season a meat when making a sauce?

Employer demanding to see degree after poor code review

Ticket to ride, 1910: What are the big cities

Would Brexit have gone ahead by now if Gina Miller had not forced the Government to involve Parliament?

Did people go back to where they were?

Why colon to denote that a value belongs to a type?

Why were helmets and other body armour not commonplace in the 1800s?

Can I install both XCode & Android Studio on MacBook Air with only 8 GB of Ram

Computing the matrix powers of a non-diagonalizable matrix

keyval - function for keyB should act dependent on value of keyA - how to do this?

How to Pin Point Large File eating space in Fedora 18

Boss wants me to falsify a report. How should I document this unethical demand?

Why do Ryanair allow me to book connecting itineraries through a third party, but not through their own website?

Why do airplanes use an axial flow jet engine instead of a more compact centrifugal jet engine?

When and what was the first 3D acceleration device ever released?

Find limit in use of integrals

Is CD audio quality good enough?



Cipher Block Chaining - How do you change the plaintext of all blocks?


A simple block cipher based on the SHA-256 hash functionWhy, or when, to use an Initialization Vector?Precisely how does CBC mode use the initialization vector?Understanding generation of IV in CBC encryptionHow can you change this message which is in block cipher AES-256 in CBC?Cipher Feedback Mode - sizes of the blocks and shift registersCan blocks in AES-CBC ciphertext be manipulated in such a way that plaintext becomes shuffled?Cipher Block Chaining Ciphertext AlterationHow to change the known ciphertext so the known plaintext is changed in AES CBC mode?Signal Protocol Header key encryption initialization vector













1












$begingroup$


I've just read about CBC encryption and decryption and was wondering how you can change every plaintext block?



Let's say you have an initialization vector, 3 ciphertext blocks, know each block-cipher-decryption and you know each plaintext block too. Then you have some string that you want to change these given plaintexts to. Edit: Assume there is a padding oracle available as well.



If I understood correctly, it will be quite easy to change the very first plaintext block: You take each byte of the initialization vector XORed with each byte of the first plaintext block XORed with the character of the string you want to change these plaintexts to. Putting all these new bytes together, this is now the new initialization vector and XORing this new initialization vector with the first ciphertext block, we will get another plaintext; that one we wanted.



The change of the iv has no effect on the plaintext of the next ciphertext block. But now in order to change the next, namely the second plaintext, we would have to do changes on the first ciphertext block which will sadly destroy the first plaintext block... And the same will happen if we move to the next ciphertext block and try to change its plaintext. So, in the end, there will just be junk plaintext or nothing at all, bad format. But I don't see any other way where you could change all plaintext blocks correctly? : /



I've mainly oriented myself on this nice diagram here from Wikipedia:



enter image description here










share|improve this question









New contributor



tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$
















    1












    $begingroup$


    I've just read about CBC encryption and decryption and was wondering how you can change every plaintext block?



    Let's say you have an initialization vector, 3 ciphertext blocks, know each block-cipher-decryption and you know each plaintext block too. Then you have some string that you want to change these given plaintexts to. Edit: Assume there is a padding oracle available as well.



    If I understood correctly, it will be quite easy to change the very first plaintext block: You take each byte of the initialization vector XORed with each byte of the first plaintext block XORed with the character of the string you want to change these plaintexts to. Putting all these new bytes together, this is now the new initialization vector and XORing this new initialization vector with the first ciphertext block, we will get another plaintext; that one we wanted.



    The change of the iv has no effect on the plaintext of the next ciphertext block. But now in order to change the next, namely the second plaintext, we would have to do changes on the first ciphertext block which will sadly destroy the first plaintext block... And the same will happen if we move to the next ciphertext block and try to change its plaintext. So, in the end, there will just be junk plaintext or nothing at all, bad format. But I don't see any other way where you could change all plaintext blocks correctly? : /



    I've mainly oriented myself on this nice diagram here from Wikipedia:



    enter image description here










    share|improve this question









    New contributor



    tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






    $endgroup$














      1












      1








      1





      $begingroup$


      I've just read about CBC encryption and decryption and was wondering how you can change every plaintext block?



      Let's say you have an initialization vector, 3 ciphertext blocks, know each block-cipher-decryption and you know each plaintext block too. Then you have some string that you want to change these given plaintexts to. Edit: Assume there is a padding oracle available as well.



      If I understood correctly, it will be quite easy to change the very first plaintext block: You take each byte of the initialization vector XORed with each byte of the first plaintext block XORed with the character of the string you want to change these plaintexts to. Putting all these new bytes together, this is now the new initialization vector and XORing this new initialization vector with the first ciphertext block, we will get another plaintext; that one we wanted.



      The change of the iv has no effect on the plaintext of the next ciphertext block. But now in order to change the next, namely the second plaintext, we would have to do changes on the first ciphertext block which will sadly destroy the first plaintext block... And the same will happen if we move to the next ciphertext block and try to change its plaintext. So, in the end, there will just be junk plaintext or nothing at all, bad format. But I don't see any other way where you could change all plaintext blocks correctly? : /



      I've mainly oriented myself on this nice diagram here from Wikipedia:



      enter image description here










      share|improve this question









      New contributor



      tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      $endgroup$




      I've just read about CBC encryption and decryption and was wondering how you can change every plaintext block?



      Let's say you have an initialization vector, 3 ciphertext blocks, know each block-cipher-decryption and you know each plaintext block too. Then you have some string that you want to change these given plaintexts to. Edit: Assume there is a padding oracle available as well.



      If I understood correctly, it will be quite easy to change the very first plaintext block: You take each byte of the initialization vector XORed with each byte of the first plaintext block XORed with the character of the string you want to change these plaintexts to. Putting all these new bytes together, this is now the new initialization vector and XORing this new initialization vector with the first ciphertext block, we will get another plaintext; that one we wanted.



      The change of the iv has no effect on the plaintext of the next ciphertext block. But now in order to change the next, namely the second plaintext, we would have to do changes on the first ciphertext block which will sadly destroy the first plaintext block... And the same will happen if we move to the next ciphertext block and try to change its plaintext. So, in the end, there will just be junk plaintext or nothing at all, bad format. But I don't see any other way where you could change all plaintext blocks correctly? : /



      I've mainly oriented myself on this nice diagram here from Wikipedia:



      enter image description here







      encryption aes cbc attack






      share|improve this question









      New contributor



      tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 4 hours ago









      kelalaka

      9,22232352




      9,22232352






      New contributor



      tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 8 hours ago









      tenepolistenepolis

      1063




      1063




      New contributor



      tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      tenepolis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          4












          $begingroup$

          If this is all you have, then I think you can't.
          You can easily get 1st and 3rd block.
          Change the 2nd ciphertext to get the desired result of 3rd block and change IV to get the desired result for first.
          But changing a cipher text block means you no longer have the results of the block cipher decryption.



          If you have however limited access to a decryption oracle then you will just need to make trial decryption of two blocks. The ciphertext of block 2 which makes the 3rd block what you want. And then given it, you choose the ciphertext for block 1 which you send to decryption in order to calculate required IV.






          share|improve this answer









          $endgroup$













            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "281"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            tenepolis is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f70817%2fcipher-block-chaining-how-do-you-change-the-plaintext-of-all-blocks%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4












            $begingroup$

            If this is all you have, then I think you can't.
            You can easily get 1st and 3rd block.
            Change the 2nd ciphertext to get the desired result of 3rd block and change IV to get the desired result for first.
            But changing a cipher text block means you no longer have the results of the block cipher decryption.



            If you have however limited access to a decryption oracle then you will just need to make trial decryption of two blocks. The ciphertext of block 2 which makes the 3rd block what you want. And then given it, you choose the ciphertext for block 1 which you send to decryption in order to calculate required IV.






            share|improve this answer









            $endgroup$

















              4












              $begingroup$

              If this is all you have, then I think you can't.
              You can easily get 1st and 3rd block.
              Change the 2nd ciphertext to get the desired result of 3rd block and change IV to get the desired result for first.
              But changing a cipher text block means you no longer have the results of the block cipher decryption.



              If you have however limited access to a decryption oracle then you will just need to make trial decryption of two blocks. The ciphertext of block 2 which makes the 3rd block what you want. And then given it, you choose the ciphertext for block 1 which you send to decryption in order to calculate required IV.






              share|improve this answer









              $endgroup$















                4












                4








                4





                $begingroup$

                If this is all you have, then I think you can't.
                You can easily get 1st and 3rd block.
                Change the 2nd ciphertext to get the desired result of 3rd block and change IV to get the desired result for first.
                But changing a cipher text block means you no longer have the results of the block cipher decryption.



                If you have however limited access to a decryption oracle then you will just need to make trial decryption of two blocks. The ciphertext of block 2 which makes the 3rd block what you want. And then given it, you choose the ciphertext for block 1 which you send to decryption in order to calculate required IV.






                share|improve this answer









                $endgroup$



                If this is all you have, then I think you can't.
                You can easily get 1st and 3rd block.
                Change the 2nd ciphertext to get the desired result of 3rd block and change IV to get the desired result for first.
                But changing a cipher text block means you no longer have the results of the block cipher decryption.



                If you have however limited access to a decryption oracle then you will just need to make trial decryption of two blocks. The ciphertext of block 2 which makes the 3rd block what you want. And then given it, you choose the ciphertext for block 1 which you send to decryption in order to calculate required IV.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 7 hours ago









                Meir MaorMeir Maor

                5,45711030




                5,45711030




















                    tenepolis is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    tenepolis is a new contributor. Be nice, and check out our Code of Conduct.












                    tenepolis is a new contributor. Be nice, and check out our Code of Conduct.











                    tenepolis is a new contributor. Be nice, and check out our Code of Conduct.














                    Thanks for contributing an answer to Cryptography Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f70817%2fcipher-block-chaining-how-do-you-change-the-plaintext-of-all-blocks%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                    Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу