{"id":222,"date":"2018-07-23T09:27:11","date_gmt":"2018-07-23T09:27:11","guid":{"rendered":"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=222"},"modified":"2018-12-27T11:25:30","modified_gmt":"2018-12-27T11:25:30","slug":"modes-of-operation","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/chapter\/modes-of-operation\/","title":{"rendered":"Modes of Operation"},"content":{"raw":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/txPRBoJMnr8\" target=\"_blank\" rel=\"noopener\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>Learning Objectives<\/strong>\r\n<ul>\r\n \t<li>To understand the Overview of Modes of Operation<\/li>\r\n \t<li>Discuss about each mode of operation such as EBC, CBC, CFB, OFB, CTR<\/li>\r\n \t<li>To Compare different modes and to discuss remarks over them<\/li>\r\n<\/ul>\r\n<div>\r\n\r\n<strong>18.1.<\/strong>\u00a0\u00a0\u00a0 <strong>INTRODUCTION<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">So far we have seen the basic working of block ciphers. In this section, we discuss about modes of operation of block ciphers. Basically the lengthy plain text is divided into number of blocks in block ciphers. Block ciphers encrypt fixed size blocks eg. DES encrypts 64-bit blocks, with 56-bit key. But in actual scenario, the file size which has to be encrypted may not be the multiple of the block size. That is in practise, we usually need to handle arbitrary amounts of data, which may be available in advance (in which case a block mode is appropriate), and may only be available a bit\/byte at a time (in which case a stream mode is used). A mode of operation describes the process of encrypting each of these blocks under a single\u00a0key. A mode of operation describes the process of encrypting each of these blocks under a single key. Some modes may use randomised addition input value. We can apply a particular mode of operation in this situation. Basic modes of operations such as Electronic Code Book(ECB), Cipher Block Chaining(CBC), Cipher Feed Back (CFB), Output Feed Back (OFB), Counter (CTR) modes are considered here<\/p>\r\n<img class=\"size-full wp-image-223 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4.png\" alt=\"\" width=\"571\" height=\"162\" \/>\r\n\r\n<\/div>\r\nTerms used :\r\n<ul>\r\n \t<li>Initialize Vector (IV)\r\n<ul>\r\n \t<li>a block of bits to randomize the encryption and hence to produce distinct ciphertext<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<ul>\r\n \t<li>Nonce : Number (used) Once\r\n<ul>\r\n \t<li>Random of psuedorandom number to ensure that past communications can not be reused in replay attacks. Some also refer to initialize vector as nonce<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>Padding\r\n<ul>\r\n \t<li>Final<span style=\"text-align: initial;font-size: 1em\"> block may require a padding to fit a block size. Add null Bytes, Add 0x80 and many 0x00, Add <\/span>the <em style=\"text-align: initial;font-size: 1em\">n<\/em><span style=\"text-align: initial;font-size: 1em\"> bytes with value <\/span><em style=\"text-align: initial;font-size: 1em\">n<\/em><span style=\"text-align: initial;font-size: 1em\"> are the different methods to achieve padding.<\/span><\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<strong>18.2.<\/strong>\u00a0\u00a0\u00a0 <strong>Electronic Codebook Book (ECB)<\/strong>\r\n\r\n&nbsp;\r\n\r\nMessage is broken into independent blocks which are encrypted\r\n\r\n&nbsp;\r\n\r\nEach block is a value which is substituted, like a codebook, hence name\r\n\r\n&nbsp;\r\n\r\nEach block is encoded independently of the other blocks\r\n\r\n&nbsp;\r\n\r\nC<sub>i<\/sub> = EK (P<sub>i<\/sub>)\r\n<div>\r\n\r\nUses: secure transmission of single values\r\n\r\n<\/div>\r\n<strong>ECB Scheme<\/strong>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-224 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5.png\" alt=\"\" width=\"576\" height=\"249\" \/>\r\n\r\n&nbsp;\r\n\r\n<strong>Remarks on ECB<\/strong>\r\n\r\n&nbsp;\r\n<ul>\r\n \t<li>Strength: it\u2019s simple.<\/li>\r\n \t<li>Weakness:\r\n<ul>\r\n \t<li>Repetitive<span style=\"text-align: initial;font-size: 1em\"> information contained in the plaintext may show in the <\/span>ciphertext,<span style=\"text-align: initial;font-size: 1em\"> if aligned with blocks.<\/span><\/li>\r\n \t<li>If the same message is encrypted (with the same key) and sent twice, their ciphertext are the same.<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>Typical application:\r\n<ul>\r\n \t<li>secure transmission of short pieces of information (e.g. a temporary encryption key)<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<strong>18.3.<\/strong>\u00a0\u00a0\u00a0 <strong>Cipher Block Chaining (CBC)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">To overcome the problems of repetitions and order independence in ECB, want some way of making the ciphertext dependent on all blocks before it. This is what CBC gives us, by combining the previous ciphertext block with the current message block before encrypting. To start the process, use an Initial Value (IV), which is usually well known (often all 0's), or otherwise is sent, ECB encrypted, just before starting\u00a0CBC use. CBC mode is applicable whenever large amounts of data need to be sent securely, provided that its available in advance (eg email, FTP, web etc)<\/p>\r\n&nbsp;\r\n\r\nUse Initial Vector (IV) to start process\r\n\r\n&nbsp;\r\n\r\nC<sub>i<\/sub> = E<sub>K<\/sub> (P<sub>i<\/sub> XOR C<sub>i-1<\/sub>)\r\n\r\n&nbsp;\r\n\r\nC<sub>0<\/sub> = IV\r\n\r\n&nbsp;\r\n\r\nUses: bulk data encryption, authentication\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-225 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6.png\" alt=\"\" width=\"638\" height=\"342\" \/>\r\n\r\n&nbsp;\r\n\r\n<strong>18.4.<\/strong>\u00a0\u00a0\u00a0 <strong>Cipher Feed Back (CFB)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">If the data is only available a bit\/byte at a time (eg. terminal session, sensor value etc), then must use some other approach to encrypting it, so as not to delay the info. Idea here is to use the block cipher essentially as a <strong>pseudo-random number<\/strong> generator (see stream cipher lecture later) and to combine these \"random\" bits with the message. Note as mentioned before, XOR is an easily inverted operator (just XOR with same thing again to undo). Again start with an IV to get things going,then use the ciphertext as the next input. As originally defined, idea was to \"consume\" as much of the \"random\" output as needed for each message unit (bit\/byte) before \"bumping\" bits out of the buffer and re-encrypting. This is wasteful though, and slows the encryption down as more encryptions are needed. An alternate way to think of it is to generate a block of \"random\" bits, consume them as message bits\/bytes arrive, and when they're used up, only then feed a full block of cipher text back. This is CFB-64 mode, the most efficient. This is the\u00a0usual choice for quantities of stream oriented data, and for authentication use.<\/p>\r\n&nbsp;\r\n\r\nPlaintext is treated as a stream of bits .Any number of bit (1, 8 or 64 or whatever) to be feed back (denoted CFB-1, CFB-8, CFB-64).\r\n\r\n&nbsp;\r\n\r\nRelation between plaintext and ciphertext\r\n\r\n&nbsp;\r\n\r\nC<sub>i<\/sub> = P<sub>i<\/sub> XOR SelectLeft(E<sub>K<\/sub> (ShiftLeft(C<sub>i<\/sub>-1)))\r\n\r\n&nbsp;\r\n\r\nC<sub>0<\/sub> = IV\r\n\r\n&nbsp;\r\n\r\nUses: stream data encryption, authentication\r\n<div>\r\n\r\n<strong>CFB Scheme<\/strong>\r\n\r\n<\/div>\r\n<img class=\"alignnone size-full wp-image-226\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7.png\" alt=\"\" width=\"536\" height=\"70\" \/>\r\n\r\n<img class=\"alignnone size-full wp-image-227\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8.png\" alt=\"\" width=\"579\" height=\"339\" \/>\r\n\r\n<img class=\"alignnone size-full wp-image-228\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9.png\" alt=\"\" width=\"480\" height=\"422\" \/>\r\n\r\nWhen the block cipher is used as a stream cipher.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In CFB mode, encipherment and decipherment use the encryption function of the underlying block cipher.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"alignnone size-full wp-image-229\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10.png\" alt=\"\" width=\"506\" height=\"268\" \/>\r\n<p style=\"text-align: justify\">Enable to encrypt any number of bits e.g. single bits or single characters (bytes)<\/p>\r\n<p style=\"text-align: justify\">S=1 : bit stream cipher<\/p>\r\n<p style=\"text-align: justify\">S=8 : character stream cipher<\/p>\r\n<p style=\"text-align: justify\">A ciphertext segment depends on the current and all preceding plaintext segments.<\/p>\r\n<p style=\"text-align: justify\">A corrupted ciphertext segment during transmission will affect the current and next several plaintext segments.<\/p>\r\n&nbsp;\r\n\r\n<strong>18.5.<\/strong>\u00a0\u00a0\u00a0 <strong>Output Feed Back (OFB)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The alternative to CFB is OFB. Here the generation of the \"random\" bits is independent of the message being encrypted. The advantage is that firstly, they can be computed in advance, good for bursty traffic, and secondly, any bit error only affects\u00a0a single bit. Thus this is good for noisy links (eg satellite TV transmissions etc). It works verysimilar to CFB .But output of the encryption function output of cipher is fed back (hence name), instead of ciphertext .Feedback is independent of message.<\/p>\r\n&nbsp;\r\n\r\nRelation between plaintext and ciphertext\r\n\r\n&nbsp;\r\n\r\nC<sub>i<\/sub> = P<sub>i<\/sub> XOR O<sub>i<\/sub>\r\n\r\n&nbsp;\r\n\r\nO<sub>i<\/sub> = E<sub>K<\/sub> (O<sub>i<\/sub>-1)\r\n\r\n&nbsp;\r\n\r\nO<sub>0<\/sub> = IV\r\n\r\n&nbsp;\r\n\r\nUses: stream encryption over noisy channels\r\n\r\n&nbsp;\r\n\r\n<strong>18.6.<\/strong>\u00a0\u00a0\u00a0 <strong>CFB V.S. OFB<\/strong>\r\n\r\n<img class=\"alignnone size-full wp-image-230\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-11.png\" alt=\"\" width=\"299\" height=\"436\" \/>\r\n\r\n<strong>18.7.<\/strong>\u00a0\u00a0\u00a0 <strong>OFB Scheme<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In OFB mode, encipherment and decipherment use the encryption function of the underlying block cipher.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"alignnone size-full wp-image-231\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12.png\" alt=\"\" width=\"503\" height=\"297\" \/>\r\n\r\n<img class=\"alignnone size-full wp-image-232\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13.png\" alt=\"\" width=\"403\" height=\"331\" \/>\r\n\r\n<strong>OFB as a Stream Cipher<\/strong>\r\n\r\n<img class=\"alignnone size-full wp-image-233\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14.png\" alt=\"\" width=\"480\" height=\"297\" \/>\r\n<p style=\"text-align: justify\">Because the \"random\" bits are independent of the message, they must never ever be used more than once (otherwise the 2 ciphertexts can be combined, cancelling these bits, and leaving a \"book\" cipher to solve). Also, as noted, should only ever use a full block feedback ie OFB-64 mode.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Each bit in the ciphertext is independent of the previous bit or bits. This avoids error propagation<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Pre-compute of forward cipher is possible. Regarding security issue , when <em>j<\/em><sup><em>th<\/em><\/sup> plaintext is known, the <em>j<\/em><sup><em>th<\/em><\/sup> output of the forward cipher function will be known . Easily cover <em>j<\/em><sup><em>th<\/em><\/sup> plaintext block of other message with the same IV . This scheme requires the IV is a nonce.<\/p>\r\n&nbsp;\r\n<div>\r\n\r\n<strong>18.8.<\/strong>\u00a0\u00a0\u00a0 <strong>Counter (CTR)<\/strong>\r\n\r\n&nbsp;\r\n\r\nHere, we encrypts counter value with the key rather than any feedback value (no feedback).\r\n\r\n<\/div>\r\nCounter for each plaintext will be different .It can be any function which produces a sequence which is guaranteed not to repeat for a long time.\r\n\r\n&nbsp;\r\n\r\nC<sub>i<\/sub> = P<sub>i<\/sub> XOR O<sub>i<\/sub>\r\n\r\nO<sub>i<\/sub> = E<sub>K<\/sub> (i)\r\n\r\n&nbsp;\r\n\r\nUses: high-speed network encryptions\r\n\r\n&nbsp;\r\n\r\n<img class=\"alignnone size-full wp-image-234\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15.png\" alt=\"\" width=\"478\" height=\"296\" \/>\r\n\r\n<img class=\"alignnone size-full wp-image-235\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16.png\" alt=\"\" width=\"480\" height=\"382\" \/><img class=\"alignnone size-full wp-image-236\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17.png\" alt=\"\" width=\"535\" height=\"329\" \/>\r\n\r\n&nbsp;\r\n\r\n<strong>Remark on CTR<\/strong>\r\n<ul>\r\n \t<li>Strengths:\r\n<ul>\r\n \t<li>Needs only the encryption algorithm<\/li>\r\n \t<li>Random access to encrypted data blocks<\/li>\r\n \t<li>Simple; fast encryption\/decryption<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>Counter must be\r\n<ul>\r\n \t<li>Must be unknown and unpredictable<\/li>\r\n \t<li>pseudo-randomness in the key stream<span style=\"text-align: initial;font-size: 1em\"> is a goal<\/span><\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<strong>Remarks on each mode<\/strong>\r\n\r\n&nbsp;\r\n\r\nBasically two types of ciphers are there:\r\n<ul>\r\n \t<li>Block cipher<\/li>\r\n \t<li>Stream cipher<\/li>\r\n<\/ul>\r\n<p style=\"text-align: justify\">CBC is an excellent block cipher.CFB, OFB, and CTR are stream ciphers.CTR is faster because simpler and it allows parallel processing.<\/p>\r\n&nbsp;\r\n\r\n<strong>Modes and IV<\/strong>\r\n\r\n&nbsp;\r\n<ul>\r\n \t<li>An IV has different security requirements than a key. Generally, an IV will not be reused under the same key .<\/li>\r\n \t<li>CBC and CFB\r\n<ul>\r\n \t<li>Reusing an IV leaks some information about the first block of plaintext, and about any common prefix shared by the two messages<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>OFB and CTR\r\n<ul>\r\n \t<li>Reusing an IV completely destroys security<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<strong>18.9.<\/strong>\u00a0\u00a0\u00a0 <strong>CBC and CTR comparison<\/strong>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-239 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50.png\" alt=\"\" width=\"492\" height=\"118\" \/><img class=\"size-full wp-image-240 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1.png\" alt=\"\" width=\"491\" height=\"180\" \/>\r\n\r\n<strong>Comparison of Different Modes<\/strong>\r\n\r\n<img class=\"alignnone size-full wp-image-243\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2.png\" alt=\"\" width=\"490\" height=\"306\" \/>\r\n\r\n<strong>Comparison of Modes<\/strong>\r\n\r\n<img class=\"alignnone size-full wp-image-244\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3.png\" alt=\"\" width=\"617\" height=\"535\" \/>\r\n<div>\r\n<p style=\"text-align: justify\">ECB, CBC, OFB, CFB, CTR, and XTS modes only provide confidentiality. To ensure an encrypted message is not accidentally modified or maliciously tampered requires a separate Message Authentication Code (MAC).<\/p>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify\">Several MAC schemes such as HMAC, CMAC and GMAC are available. But compositing a confidentiality mode with an authenticity mode could be difficult and error prone. The modes that so far discussed were mainly devised for DES. New modes combined confidentiality and data integrity into a single cryptographic primitive such as CCM, GCM, CWC, EAX, IAPM and OCB are proposed for AES.<\/p>\r\n&nbsp;\r\n\r\n<strong>SUMMARY<\/strong>\r\n<ul>\r\n \t<li>Discussed about different modes of ciphers<\/li>\r\n \t<li>Discussed encryption and decryption in each mode.<\/li>\r\n \t<li>Comparative study is carried out in different modes.<\/li>\r\n<\/ul>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on Modes of Operation<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/txPRBoJMnr8\" target=\"_blank\" rel=\"noopener\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n\r\n<img class=\"size-full wp-image-245 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46.jpg\" alt=\"\" width=\"502\" height=\"396\" \/>","rendered":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/txPRBoJMnr8\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Learning Objectives<\/strong><\/p>\n<ul>\n<li>To understand the Overview of Modes of Operation<\/li>\n<li>Discuss about each mode of operation such as EBC, CBC, CFB, OFB, CTR<\/li>\n<li>To Compare different modes and to discuss remarks over them<\/li>\n<\/ul>\n<div>\n<p><strong>18.1.<\/strong>\u00a0\u00a0\u00a0 <strong>INTRODUCTION<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">So far we have seen the basic working of block ciphers. In this section, we discuss about modes of operation of block ciphers. Basically the lengthy plain text is divided into number of blocks in block ciphers. Block ciphers encrypt fixed size blocks eg. DES encrypts 64-bit blocks, with 56-bit key. But in actual scenario, the file size which has to be encrypted may not be the multiple of the block size. That is in practise, we usually need to handle arbitrary amounts of data, which may be available in advance (in which case a block mode is appropriate), and may only be available a bit\/byte at a time (in which case a stream mode is used). A mode of operation describes the process of encrypting each of these blocks under a single\u00a0key. A mode of operation describes the process of encrypting each of these blocks under a single key. Some modes may use randomised addition input value. We can apply a particular mode of operation in this situation. Basic modes of operations such as Electronic Code Book(ECB), Cipher Block Chaining(CBC), Cipher Feed Back (CFB), Output Feed Back (OFB), Counter (CTR) modes are considered here<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-223 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4.png\" alt=\"\" width=\"571\" height=\"162\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4.png 571w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4-300x85.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4-65x18.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4-225x64.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-4-350x99.png 350w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/p>\n<\/div>\n<p>Terms used :<\/p>\n<ul>\n<li>Initialize Vector (IV)\n<ul>\n<li>a block of bits to randomize the encryption and hence to produce distinct ciphertext<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>Nonce : Number (used) Once\n<ul>\n<li>Random of psuedorandom number to ensure that past communications can not be reused in replay attacks. Some also refer to initialize vector as nonce<\/li>\n<\/ul>\n<\/li>\n<li>Padding\n<ul>\n<li>Final<span style=\"text-align: initial;font-size: 1em\"> block may require a padding to fit a block size. Add null Bytes, Add 0x80 and many 0x00, Add <\/span>the <em style=\"text-align: initial;font-size: 1em\">n<\/em><span style=\"text-align: initial;font-size: 1em\"> bytes with value <\/span><em style=\"text-align: initial;font-size: 1em\">n<\/em><span style=\"text-align: initial;font-size: 1em\"> are the different methods to achieve padding.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>18.2.<\/strong>\u00a0\u00a0\u00a0 <strong>Electronic Codebook Book (ECB)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Message is broken into independent blocks which are encrypted<\/p>\n<p>&nbsp;<\/p>\n<p>Each block is a value which is substituted, like a codebook, hence name<\/p>\n<p>&nbsp;<\/p>\n<p>Each block is encoded independently of the other blocks<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>i<\/sub> = EK (P<sub>i<\/sub>)<\/p>\n<div>\n<p>Uses: secure transmission of single values<\/p>\n<\/div>\n<p><strong>ECB Scheme<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-224 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5.png\" alt=\"\" width=\"576\" height=\"249\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5.png 576w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5-300x130.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5-65x28.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5-225x97.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-5-350x151.png 350w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Remarks on ECB<\/strong><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Strength: it\u2019s simple.<\/li>\n<li>Weakness:\n<ul>\n<li>Repetitive<span style=\"text-align: initial;font-size: 1em\"> information contained in the plaintext may show in the <\/span>ciphertext,<span style=\"text-align: initial;font-size: 1em\"> if aligned with blocks.<\/span><\/li>\n<li>If the same message is encrypted (with the same key) and sent twice, their ciphertext are the same.<\/li>\n<\/ul>\n<\/li>\n<li>Typical application:\n<ul>\n<li>secure transmission of short pieces of information (e.g. a temporary encryption key)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>18.3.<\/strong>\u00a0\u00a0\u00a0 <strong>Cipher Block Chaining (CBC)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">To overcome the problems of repetitions and order independence in ECB, want some way of making the ciphertext dependent on all blocks before it. This is what CBC gives us, by combining the previous ciphertext block with the current message block before encrypting. To start the process, use an Initial Value (IV), which is usually well known (often all 0&#8217;s), or otherwise is sent, ECB encrypted, just before starting\u00a0CBC use. CBC mode is applicable whenever large amounts of data need to be sent securely, provided that its available in advance (eg email, FTP, web etc)<\/p>\n<p>&nbsp;<\/p>\n<p>Use Initial Vector (IV) to start process<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>i<\/sub> = E<sub>K<\/sub> (P<sub>i<\/sub> XOR C<sub>i-1<\/sub>)<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>0<\/sub> = IV<\/p>\n<p>&nbsp;<\/p>\n<p>Uses: bulk data encryption, authentication<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-225 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6.png\" alt=\"\" width=\"638\" height=\"342\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6.png 638w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6-300x161.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6-65x35.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6-225x121.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-6-350x188.png 350w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>18.4.<\/strong>\u00a0\u00a0\u00a0 <strong>Cipher Feed Back (CFB)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">If the data is only available a bit\/byte at a time (eg. terminal session, sensor value etc), then must use some other approach to encrypting it, so as not to delay the info. Idea here is to use the block cipher essentially as a <strong>pseudo-random number<\/strong> generator (see stream cipher lecture later) and to combine these &#8220;random&#8221; bits with the message. Note as mentioned before, XOR is an easily inverted operator (just XOR with same thing again to undo). Again start with an IV to get things going,then use the ciphertext as the next input. As originally defined, idea was to &#8220;consume&#8221; as much of the &#8220;random&#8221; output as needed for each message unit (bit\/byte) before &#8220;bumping&#8221; bits out of the buffer and re-encrypting. This is wasteful though, and slows the encryption down as more encryptions are needed. An alternate way to think of it is to generate a block of &#8220;random&#8221; bits, consume them as message bits\/bytes arrive, and when they&#8217;re used up, only then feed a full block of cipher text back. This is CFB-64 mode, the most efficient. This is the\u00a0usual choice for quantities of stream oriented data, and for authentication use.<\/p>\n<p>&nbsp;<\/p>\n<p>Plaintext is treated as a stream of bits .Any number of bit (1, 8 or 64 or whatever) to be feed back (denoted CFB-1, CFB-8, CFB-64).<\/p>\n<p>&nbsp;<\/p>\n<p>Relation between plaintext and ciphertext<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>i<\/sub> = P<sub>i<\/sub> XOR SelectLeft(E<sub>K<\/sub> (ShiftLeft(C<sub>i<\/sub>-1)))<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>0<\/sub> = IV<\/p>\n<p>&nbsp;<\/p>\n<p>Uses: stream data encryption, authentication<\/p>\n<div>\n<p><strong>CFB Scheme<\/strong><\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-226\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7.png\" alt=\"\" width=\"536\" height=\"70\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7.png 536w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7-300x39.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7-65x8.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7-225x29.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-7-350x46.png 350w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-227\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8.png\" alt=\"\" width=\"579\" height=\"339\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8.png 579w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8-300x176.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8-65x38.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8-225x132.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-8-350x205.png 350w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-228\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9.png\" alt=\"\" width=\"480\" height=\"422\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9.png 480w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9-300x264.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9-65x57.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9-225x198.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-9-350x308.png 350w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>When the block cipher is used as a stream cipher.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In CFB mode, encipherment and decipherment use the encryption function of the underlying block cipher.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-229\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10.png\" alt=\"\" width=\"506\" height=\"268\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10.png 506w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10-300x159.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10-65x34.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10-225x119.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-10-350x185.png 350w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/p>\n<p style=\"text-align: justify\">Enable to encrypt any number of bits e.g. single bits or single characters (bytes)<\/p>\n<p style=\"text-align: justify\">S=1 : bit stream cipher<\/p>\n<p style=\"text-align: justify\">S=8 : character stream cipher<\/p>\n<p style=\"text-align: justify\">A ciphertext segment depends on the current and all preceding plaintext segments.<\/p>\n<p style=\"text-align: justify\">A corrupted ciphertext segment during transmission will affect the current and next several plaintext segments.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>18.5.<\/strong>\u00a0\u00a0\u00a0 <strong>Output Feed Back (OFB)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The alternative to CFB is OFB. Here the generation of the &#8220;random&#8221; bits is independent of the message being encrypted. The advantage is that firstly, they can be computed in advance, good for bursty traffic, and secondly, any bit error only affects\u00a0a single bit. Thus this is good for noisy links (eg satellite TV transmissions etc). It works verysimilar to CFB .But output of the encryption function output of cipher is fed back (hence name), instead of ciphertext .Feedback is independent of message.<\/p>\n<p>&nbsp;<\/p>\n<p>Relation between plaintext and ciphertext<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>i<\/sub> = P<sub>i<\/sub> XOR O<sub>i<\/sub><\/p>\n<p>&nbsp;<\/p>\n<p>O<sub>i<\/sub> = E<sub>K<\/sub> (O<sub>i<\/sub>-1)<\/p>\n<p>&nbsp;<\/p>\n<p>O<sub>0<\/sub> = IV<\/p>\n<p>&nbsp;<\/p>\n<p>Uses: stream encryption over noisy channels<\/p>\n<p>&nbsp;<\/p>\n<p><strong>18.6.<\/strong>\u00a0\u00a0\u00a0 <strong>CFB V.S. OFB<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-230\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-11.png\" alt=\"\" width=\"299\" height=\"436\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-11.png 299w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-11-206x300.png 206w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-11-65x95.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-11-225x328.png 225w\" sizes=\"auto, (max-width: 299px) 100vw, 299px\" \/><\/p>\n<p><strong>18.7.<\/strong>\u00a0\u00a0\u00a0 <strong>OFB Scheme<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In OFB mode, encipherment and decipherment use the encryption function of the underlying block cipher.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-231\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12.png\" alt=\"\" width=\"503\" height=\"297\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12.png 503w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12-300x177.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12-65x38.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12-225x133.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-12-350x207.png 350w\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-232\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13.png\" alt=\"\" width=\"403\" height=\"331\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13.png 403w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13-300x246.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13-65x53.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13-225x185.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-13-350x287.png 350w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/p>\n<p><strong>OFB as a Stream Cipher<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-233\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14.png\" alt=\"\" width=\"480\" height=\"297\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14.png 480w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14-300x186.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14-65x40.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14-225x139.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-14-350x217.png 350w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p style=\"text-align: justify\">Because the &#8220;random&#8221; bits are independent of the message, they must never ever be used more than once (otherwise the 2 ciphertexts can be combined, cancelling these bits, and leaving a &#8220;book&#8221; cipher to solve). Also, as noted, should only ever use a full block feedback ie OFB-64 mode.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Each bit in the ciphertext is independent of the previous bit or bits. This avoids error propagation<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Pre-compute of forward cipher is possible. Regarding security issue , when <em>j<\/em><sup><em>th<\/em><\/sup> plaintext is known, the <em>j<\/em><sup><em>th<\/em><\/sup> output of the forward cipher function will be known . Easily cover <em>j<\/em><sup><em>th<\/em><\/sup> plaintext block of other message with the same IV . This scheme requires the IV is a nonce.<\/p>\n<p>&nbsp;<\/p>\n<div>\n<p><strong>18.8.<\/strong>\u00a0\u00a0\u00a0 <strong>Counter (CTR)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Here, we encrypts counter value with the key rather than any feedback value (no feedback).<\/p>\n<\/div>\n<p>Counter for each plaintext will be different .It can be any function which produces a sequence which is guaranteed not to repeat for a long time.<\/p>\n<p>&nbsp;<\/p>\n<p>C<sub>i<\/sub> = P<sub>i<\/sub> XOR O<sub>i<\/sub><\/p>\n<p>O<sub>i<\/sub> = E<sub>K<\/sub> (i)<\/p>\n<p>&nbsp;<\/p>\n<p>Uses: high-speed network encryptions<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-234\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15.png\" alt=\"\" width=\"478\" height=\"296\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15.png 478w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15-300x186.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15-65x40.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15-225x139.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-15-350x217.png 350w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-235\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16.png\" alt=\"\" width=\"480\" height=\"382\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16.png 480w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16-300x239.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16-65x52.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16-225x179.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-16-350x279.png 350w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-236\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17.png\" alt=\"\" width=\"535\" height=\"329\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17.png 535w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17-300x184.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17-65x40.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17-225x138.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Untitled-17-350x215.png 350w\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Remark on CTR<\/strong><\/p>\n<ul>\n<li>Strengths:\n<ul>\n<li>Needs only the encryption algorithm<\/li>\n<li>Random access to encrypted data blocks<\/li>\n<li>Simple; fast encryption\/decryption<\/li>\n<\/ul>\n<\/li>\n<li>Counter must be\n<ul>\n<li>Must be unknown and unpredictable<\/li>\n<li>pseudo-randomness in the key stream<span style=\"text-align: initial;font-size: 1em\"> is a goal<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Remarks on each mode<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Basically two types of ciphers are there:<\/p>\n<ul>\n<li>Block cipher<\/li>\n<li>Stream cipher<\/li>\n<\/ul>\n<p style=\"text-align: justify\">CBC is an excellent block cipher.CFB, OFB, and CTR are stream ciphers.CTR is faster because simpler and it allows parallel processing.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Modes and IV<\/strong><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>An IV has different security requirements than a key. Generally, an IV will not be reused under the same key .<\/li>\n<li>CBC and CFB\n<ul>\n<li>Reusing an IV leaks some information about the first block of plaintext, and about any common prefix shared by the two messages<\/li>\n<\/ul>\n<\/li>\n<li>OFB and CTR\n<ul>\n<li>Reusing an IV completely destroys security<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>18.9.<\/strong>\u00a0\u00a0\u00a0 <strong>CBC and CTR comparison<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-239 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50.png\" alt=\"\" width=\"492\" height=\"118\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50.png 492w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50-300x72.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50-65x16.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50-225x54.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/1-50-350x84.png 350w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-240 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1.png\" alt=\"\" width=\"491\" height=\"180\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1.png 491w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1-300x110.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1-65x24.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1-225x82.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-1-350x128.png 350w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/p>\n<p><strong>Comparison of Different Modes<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-243\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2.png\" alt=\"\" width=\"490\" height=\"306\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2.png 490w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2-300x187.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2-65x41.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2-225x141.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-2-350x219.png 350w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/p>\n<p><strong>Comparison of Modes<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-244\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3.png\" alt=\"\" width=\"617\" height=\"535\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3.png 617w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3-300x260.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3-65x56.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3-225x195.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/2-3-350x303.png 350w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><\/p>\n<div>\n<p style=\"text-align: justify\">ECB, CBC, OFB, CFB, CTR, and XTS modes only provide confidentiality. To ensure an encrypted message is not accidentally modified or maliciously tampered requires a separate Message Authentication Code (MAC).<\/p>\n<\/div>\n<p style=\"text-align: justify\">Several MAC schemes such as HMAC, CMAC and GMAC are available. But compositing a confidentiality mode with an authenticity mode could be difficult and error prone. The modes that so far discussed were mainly devised for DES. New modes combined confidentiality and data integrity into a single cryptographic primitive such as CCM, GCM, CWC, EAX, IAPM and OCB are proposed for AES.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>SUMMARY<\/strong><\/p>\n<ul>\n<li>Discussed about different modes of ciphers<\/li>\n<li>Discussed encryption and decryption in each mode.<\/li>\n<li>Comparative study is carried out in different modes.<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on Modes of Operation<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/txPRBoJMnr8\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-245 aligncenter\" src=\"http:\/\/csp11.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46.jpg\" alt=\"\" width=\"502\" height=\"396\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46.jpg 502w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46-300x237.jpg 300w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46-65x51.jpg 65w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46-225x177.jpg 225w, https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-content\/uploads\/sites\/55\/2018\/07\/Capture-46-350x276.jpg 350w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/p>\n","protected":false},"author":3,"menu_order":17,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-222","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/chapters\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":6,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/chapters\/222\/revisions"}],"predecessor-version":[{"id":565,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/chapters\/222\/revisions\/565"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/chapters\/222\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/pressbooks\/v2\/chapter-type?post=222"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/wp\/v2\/contributor?post=222"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp11\/wp-json\/wp\/v2\/license?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}