Posted on Categories:Cryptography, 密码学, 数学代写

# 数学代写|密码学代写Cryptography Theory代考|CSE546 Linear Feedback Shift Registers

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|密码学Cryptography Theory代考|Linear Feedback Shift Registers

When we moved to “degree 2,” for congruential generators, we might have written the equation as
$$X_n=\left(a X_{n-1}+b X_{n-2}+c\right)(\bmod m)$$
This way each value depends on the two previous values (hence, degree 2) and we can attain longer periods. Nothing is squared. We would, of course, need two seed values $X_0$ and $X_1$. The first number we generate would be $X_2$. This is the basic idea behind linear feedback shift registers (LFSRs). They are very fast (in hardware) when working with bits modulo 2 . We could indicate $\bmod 2$ by setting $m=2$, but as we’ve seen before, the convention is to replace + with $\oplus$ to represent XOR, which is the same as addition modulo 2. LFSRs are usually represented diagrammatically rather than algebraically (Figure 19.1).

The figure is best explained with an example. We may seed the register (the values of the $b$ s) with the bits 101; that is $b_3=1, b_2=0$, and $b_1=1$. The diagonal arrows indicate that we get our new bit by taking the XOR of $b_3$ and $b_1$, which is $1 \oplus 1=0$. Notice that $b_2$ is not used in this calculation. The bits that are used, $b_3$ and $b_1$, are referred to as the taps. The new bit that is calculated, based on the taps, follows the longest arrow and takes the place of $b_3$, but $b_3$ doesn’t just vanish. Instead, it advances to the right to take the place of $b_2$, which in turn advances to the right to replace $b_1$. With nowhere left to go, $b_1$ “falls of the edge” (indicated by the shortest arrow) and is gone. These steps are then all repeated with the new values. Starting with the seed, our register holds the following values, as we iterate:
\begin{aligned} & 101 \ & 010 \ & 001 \ & 100 \ & 110 \ & 111 \ & 011 \ & 101 \end{aligned}
which brings us back to the start. Notice that this register cycles through seven different sets of values. We say that it has period 7 . The rule depicted diagrammatically may also be represented algebraically as
$$b_{n+3}=b_{n+2} \oplus b_n, \text { for } n=1,2, \ldots$$

## 数学代写|密码学Cryptography Theory代考|LFSR Attack

With such long periods so easily obtained, a LFSR might seem like a secure system. We only broke the Vigenère cipher by taking advantage of patterns established by the repeating key, and it would take extremely long messages to have that possibility here. However, there are other mathematical options open to us for attacking this system. We will assume that for a portion of the ciphertext the corresponding plaintext is known (i.e., we have a crib). From this, we easily obtain a portion of the key. Suppose this cribbed key is 10101100 . We can see that the period is greater than or equal to 8 , because there is no repetition in the portion we recovered. Therefore, the LFSR must have at least 4 elements. Assuming it has exactly 4 elements, the LFSR must be of the form
$$b_{n+4}=a_3 b_{n+3} \oplus a_2 b_{n+2} \oplus a_1 b_{n+1} \oplus a_0 b_n$$
where each of the $a_i$ is either 0 or 1 . The string of known key bits, 10101100 , labeled $b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8$ for convenience, although they needn’t be from the start of the message, tells us
\begin{aligned} & 1=a_3 0 \oplus a_2 1 \oplus a_1 0 \oplus a_0 1 \ & 1=a_3 1 \oplus a_2 0 \oplus a_1 1 \oplus a_0 0 \ & 0=a_3 1 \oplus a_2 1 \oplus a_1 0 \oplus a_0 1 \ & 0=a_3 0 \oplus a_2 1 \oplus a_1 1 \oplus a_0 0 \end{aligned}

## 数学代写|密码学Cryptography Theory代考|Linear Feedback Shift Registers

$$X_n=\left(a X_{n-1}+b X_{n-2}+c\right)(\bmod m)$$

$$101010001 \quad 100110 \quad 111011 \quad 101$$

$$b_{n+3}=b_{n+2} \oplus b_n, \text { for } n=1,2, \ldots$$

## 数学代写|密码学Cryptography Theory代考|LFSR Attack

$$b_{n+4}=a_3 b_{n+3} \oplus a_2 b_{n+2} \oplus a_1 b_{n+1} \oplus a_0 b_n$$

$$1=a_3 0 \oplus a_2 1 \oplus a_1 0 \oplus a_0 1 \quad 1=a_3 1 \oplus a_2 0 \oplus a_1 1 \oplus a_0 00=a_3 1 \oplus a_2 1 \oplus a_1 0 \oplus a_0 1 \quad 0=a_3 0 \oplus a_2 1 \oplus a_1 1 \oplus a_0 0$$

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。