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.mzph.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…