ofb模式_密碼學中的輸出反饋模式(OFB)

ofb模式

This is an output feedback (OFB) mode is similar in structure to that of CFB in Cryptography. It is the output of the encryption function that is fed back to the shift register in OFB in the cryptography, whereas in CFB in the mode of blocks, the ciphertext unit is fed back to the shift register in the block. The other difference is that the OFB mode operates on full blocks of plaintext or original text and ciphertext, not on an s-bit subset of character. Encryption can be expressed as,

這是一種輸出反饋(OFB)模式 ,其結構與密碼學中的CFB相似。 加密功能的輸出被反饋到密碼學中的OFB中的移位寄存器,而在CFB中,在塊模式下,密文單元被反饋到該塊中的移位寄存器。 另一個區別是,OFB模式對純文本或原始文本和密文的完整塊進行操作,而不對字符的s位子集進行操作。 加密可以表示為

    Cj = Pj ? E(K, [Cj - i ? Pj - 1])

By manage the terms, we can demonstrate that decryption works as we like,

通過管理這些條款,我們可以證明解密可以按需工作,

    Pj = Cj ? E(K, [Cj - 1 ? Pj - 1])

運作方式 (Operations)

  • Let the size of a block of the character be b. If the last block of plaintext or original text contains u bits (indicated by *), with u 6 b, the most significant u bits of the last output block ON are used for the XOR operation; the remaining b -u bits of the last output block are discarded in the cryptography.

    令字符塊的大小為b。 如果明文或原始文本的最后一個塊包含u位(用*表示),則u 6為b,則將最后一個輸出塊ON的最高有效u位用于XOR操作;否則,為0。 最后輸出塊的其余b -u位在加密中被丟棄。

  • Like as with CBC and CFB, the OFB mode requires an initialization vector in the system. In the case of OFB, the IV must be a nonce; that is, the IV must be unique to each execution of the encryption operation in the cryptography. The reason for this is that the sequence of encryption output blocks of the character, Oi, depends only on the key and the IV and does not depend on the plaintext or original text. Therefore, for a given key and IV, the stream of output bits used to XOR with the stream of plaintext or original text bits is fixed. If two different messages had an identical block of plaintext or original text in an identical position, then an attacker would be able to determine what portion of the Oi stream in the cryptography.

    像CBC和CFB一樣,OFB模式需要系統中的初始化向量。 對于OFB,IV必須是隨機數; 也就是說,IV對于密碼術中加密操作的每次執行必須是唯一的。 這樣做的原因是,字符Oi的加密輸出塊的順序僅取決于密鑰和IV,而不取決于明文或原始文本。 因此,對于給定的密鑰和IV,用于與明文或原始文本位流進行XOR的輸出位流是固定的。 如果兩個不同的消息在相同位置具有相同的純文本或原始文本塊,則攻擊者將能夠確定密碼術中Oi流的哪一部分。

OFB (1)




OFB (1)


Image source: https://www.brainkart.com/article/Output-Feedback-Mode_8418/

圖片來源:https://www.brainkart.com/article/Output-Feedback-Mode_8418/

Observe that complementing a bit in the ciphertext complements the corresponding bit in the recovered plaintext or original text. Thus, controlled changes to the recovered plaintext can be made. There was the mode of operation may make it possible for an opponent, by making the necessary changes to the checksum portion of the message as well as to the data portion, to alter the ciphertext as work with keys in such a way that it is not detected by an error-correcting code in the cryptography.

請注意,對密文進行補碼可以對恢復的明文或原始文本中的對應位進行補碼。 因此,可以對恢復的明文進行受控更改。 通過對消息的校驗和部分以及數據部分進行必要的更改,操作模式可能使對手有可能更改密文,使其與密鑰一起使用,而不會由加密中的錯誤糾正代碼檢測到。

This is an OFB has the structure of a typical stream cipher, because the cipher generates a stream of bits as a function of initial value and a cryptography key, and that stream of bits is XORed with the plaintext bits or original text. The generated stream that is XORed with the plaintext or original text is itself independent of the plaintext or original text; this is highlighted by dashed boxes. One distinction from the stream ciphers is that OFB encrypts plaintext a full block at a time, where typically a block is 64 or 128 bits of the character. Many stream ciphers encrypt one byte at a time in this mode of operation.

這是一種具有典型流密碼結構的OFB,因為該密碼會根據初始值和加密密鑰生成位流,并且該位流與明文位或原始文本進行異或。 與純文本或原始文本進行異或的生成流本身獨立于純文本或原始文本; 這由虛線框突出顯示。 與流密碼的區別是OFB一次將整個塊加密明文,其中通常一個塊是字符的64或128位。 在這種操作模式下,許多流密碼一次加密一個字節。

優點 (Advantages)

  • The main advantage of the OFB method is that bit errors in transmission do not propagate in the encryption.

    OFB方法的主要優點是傳輸中的誤碼不會在加密中傳播。

  • For example, if as a bit error occurs in C1 as ciphertext, only the recovered value of P1 as plaintext is affected; subsequent plaintext units are not corrupted. With CFB, C1 as ciphertext also serves as input to the shift register and therefore causes additional corruption downstream in this mode.

    例如 ,如果在C1中作為密文發生位錯誤,則僅影響P1作為明文的恢復值; 隨后的明文單元未損壞。 使用CFB時,C1作為密文還用作移位寄存器的輸入,因此在此模式下會導致下游的其他損壞。

缺點 (Disadvantages)

  • The disadvantage of OFB is that it is more vulnerable to a message stream modification attack than is CFB in the modes of operation.

    OFB的缺點是,與CFB相比,它在操作模式下更容易受到消息流修改攻擊。

翻譯自: https://www.includehelp.com/cryptography/output-feedback-mode-ofb-in-cryptography.aspx

ofb模式

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541702.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541702.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541702.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

JavaScript0-閉包

1.閉包的概念:在JavaScript中局部作用域總是能夠訪問到全局作用域,即內部函數總是能夠訪問到外部函數的參數和變量,即使內部函數調用完畢。也就是指有權訪問到函數作用域里的變量。 function fn1() {var x 0;return function() {cosole.log(…

win8編程c語言,Win8系統怎么運行C語言 win8系統運行C語言的方法

C語言是一門通用計算機編程語言,是提供一種能以簡易的方式編譯、處理低級存儲器、產生少量的機器碼以及不需要任何運行環境支持便能運行的編程語言,但是許多win8系統用戶并不知道要怎么運行C語言,針對這個情況,小編就給大家分享一…

stack示例_C.示例中的Stack.CopyTo()方法

stack示例C#Stack.CopyTo()方法 (C# Stack.CopyTo() method) Stack.CopyTo() method is used to copy the stack elements/objects to an existing array from the given index. Stack.CopyTo()方法用于將堆棧元素/對象從給定索引復制到現有數組。 Syntax: 句法&am…

Linux sudoers文件的寫法

2019獨角獸企業重金招聘Python工程師標準>>> 文件的組成 sudoers文件由三部分組成: sudoers的默認配置,主要設置sudo的一些缺省值(本文不會對這些默認配置進行介紹,若有興趣可以自己man 5 sudoers然后搜defaults)alias…

if是什么c語言,這個C語言是什么(if(1))?

我在openssl源代碼中注意到一個奇怪的成語,here并重復如下:if ((in NULL) && (passwds NULL)) {if (1) { (* #ifndef OPENSSL_NO_UI/* build a null-terminated list */static char *passwds_static[2] { NULL, NULL };passwds passwds_static;if (in …

c#queue_帶有C#示例的Queue.CopyTo()方法

c#queueC#Queue.CopyTo()方法 (C# Queue.CopyTo() method) Queue.CopyTo() method is used to copy the Queue elements/objects to an existing array from specified index. Queue.CopyTo()方法用于將Queue元素/對象從指定的索引復制到現有數組。 Syntax: 句法&a…

指針在c語言中的運用,怎么理解C語言中的指針,如何運用?

恰好我之前寫了一系列介紹 C 語言的文章,介紹了什么是指針,以及為什么要使用指針,下面摘錄一部分,感興趣的話,可以點我了解更多。什么是 C語言指針?不同的數據類型的主要區別在于占用的存儲空間不同。我們知…

設計模式(一)單例模式的七種寫法

1. 餓漢模式 public class Singleton { private static Singleton instance new Singleton(); private Singleton (){}public static Singleton getInstance() { return instance; } } View Code這種方式在類加載時就完成了初始化,所以類加載較慢,…

scala 字符串轉換數組_如何在Scala中將字節數組轉換為字符串?

scala 字符串轉換數組Byte Array in Scala is an array of elements of a byte type. String in Scala is a collection of the character data type. Scala中的字節數組是字節類型的元素的數組。 Scala中的String是字符數據類型的集合。 將字節數組轉換為字符串 (Convert byt…

智能關機軟件 c語言,智能關機軟件

智能關機軟件是一款免費共享關機軟件。智能關機軟件不但具有定時關機、自動關機的功能,而且還可以進行定時提醒信息、打開文件、打開網頁、重啟計算機、注銷用戶、鎖定計算機、計算機休眠、計算機待機、關閉顯示器,并且可以進行多任務計劃,可…

wget: command not found

-bash: wget: command not found的兩種解決方法 今天給服務器安裝新LNMP環境時,wget 時提示 -bash:wget command not found,很明顯沒有安裝wget軟件包。一般linux最小化安裝時,wget不會默認被安裝。可以通過以下兩種方法來安裝:1、rpm 安裝rp…

數據庫數據規范化看不懂_數據庫管理系統中的規范化

數據庫數據規范化看不懂DBMS中的規范化 (Normalization in DBMS) Every table must have a single idea. The method by which we divide tables approximately is called normalization and the rest used for normalization is a functional dependency. For the normalizati…

c 語言開發一個四則運算器,C++實現四則運算器(無括號)

本文實例為大家分享了C實現無括號的四則運算器的具體代碼,供大家參考,具體內容如下完成度更高的帶括號版本可以看C實現四則運算器(帶括號)對于無括號的計算器,實現起來比較容易,下面讓我們一步步實現。舉例首先明確需要實現怎樣的…

iOS開發之解決系統數字鍵盤無文字時delete鍵無法監聽的技巧

最近在做用戶登錄獲取驗證碼時添加圖形驗證碼功能,就是只有正確輸入圖形驗證碼才能收到后臺發送的短信驗證碼。效果如下: 看起來雖然是個小功能,但是實際操作起來,會發現蘋果給我們留下的坑,當然更多的是自己給自己挖的…

c ++查找字符串_C ++結構| 查找輸出程序| 套裝1

c 查找字符串Program 1: 程序1&#xff1a; #include <iostream>#include <math.h>using namespace std;struct st {int A NULL;int B abs(EOF EOF);} S;int main(){cout << S.A << " " << S.B;return 0;}Output: 輸出&#xff1a…

二級c語言加油,二級C語言 備考指南及常見問題(2013版)

該樓層疑似違規已被系統折疊 隱藏此樓查看此樓3、關于上機操作部分的復習最好買一本上機題庫方面的教材&#xff0c;或打印、閱讀南開百題之類的電子文檔。配合上機模擬軟件(無紙化考試軟件)&#xff0c;上機練習是必須的。上機軟件一般有100套題多一點&#xff0c;每套有程序填…

開放定址散列表

再散列之后散列函數要重新計算。 // kaifangliaobiao.cpp : 定義控制臺應用程序的入口點。 //使用平方探測解決沖突問題時&#xff0c;散列表至少空一半時&#xff0c;總能插入一個新的元素#include "stdafx.h" #include<iostream> using namespace std;#ifnde…

合并兩個鏈表數據結構c語言,合并兩個鏈表.

該樓層疑似違規已被系統折疊 隱藏此樓查看此樓#include #define N1 10#define N2 10struct list{int date ;struct list *next;};main(){struct list *p1,*p2,*p3,*p4,*head,*head1,*head2,*p;int n0;head1head2NULL;p1p2(struct list *)malloc(sizeof(struct list));p1->da…

c ++查找字符串_C ++結構| 查找輸出程序| 套裝2

c 查找字符串Program 1: 程序1&#xff1a; #include <iostream>using namespace std;int main(){typedef struct{int A;char* STR;} S;S ob { 10, "india" };S* ptr;ptr &ob;cout << ptr->A << " " << ptr->STR[2];…

連接fiddler后手機無法顯示無網絡

升級了fiddler到4.6版本&#xff0c;手機設置代理后提示無網絡&#xff0c;試試以下解決方法&#xff1a; 1.fiddler升級后對應的.net framework也要升級&#xff0c;安裝最新的.net framework 4.6&#xff0c;升級安裝后&#xff0c;可以正確抓包啦 2.如果上述方法無效&#x…