应用密码学第一次作业(9.23)

一、Please briefly describe the objectives of information and network security,such as confidentiality, integrity, availability , authenticity , and accountability

The objectives of information and network security include:

  1. Confidentiality: Protecting sensitive information from unauthorized access.
  2. Integrity: Ensuring data accuracy and preventing unauthorized modifications.
  3. Availability: Ensuring resources are accessible to authorized users when needed.
  4. Authenticity: Verifying the identities of users and systems to confirm that communications are genuine.
  5. Accountability: Ensuring that user and system actions can be tracked and recorded for auditing and compliance.

二、Please encrypt the message “ Must see you at the fifth teaching building”, by using Playfair cipher with the keyword “GUETT”

Fill the keyword matrix with the rest of letters ,and remove duplicate letters
在这里插入图片描述
Group plain text
Mu st se ey ou at th ef if th te ac hi ng bu il di ng
KT RA QA TX PG GA AF TD MB AF AT UH BN IA CG KM BL IA
在这里插入图片描述
Code examples are given below:

1.#include<iostream>
2.#include<cstring>
3.
4.using namespace std;
5.void encrypt()
6.{
7.    const int N = 100;
8.    char letters[26] = "ABCDEFGHIKLMNOPQRSTUVWXYZ";//用于填充矩阵
9.    int flag[25] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };//字母是否已在矩阵中,与letters数组对应
10.    char ch[5][5];//5X5矩阵
11.    char ch1[N];//密钥
12.    char ch2[N];//明文
13.    char ch4;//无关字符
14.    int len = 'a' - 'A';
15.    cout << "输入密钥:";
16.    cin >> ch1;
17.    int flg = 1;
18.    while (flg == 1)
19.    {
20.        for (int i = 0; i < strlen(ch1); i++)//把所输入的密钥转化为大写字母
21.        {
22.            if (ch1[i] > 'z' || ch1[i] < 'a')
23.            {
24.                cout << "请重新选择操作:" << endl;
25.                flg = 0; break;
26.            }
27.            else
28.                ch1[i] = ch1[i] - len;
29.        }
30.        if (flg == 1)
31.        {
32.            for (int i = 0; i < strlen(ch1); i++)//把密钥中的J都变为I
33.            {
34.                if (ch1[i] == 'J')ch1[i] = 'I';
35.            }
36.            int i = 0; int j = 0;
37.            //把密钥中的字母填入到矩阵中,并把该字母标记为已用
38.            for (int k = 0; k < strlen(ch1); k++)
39.            {
40.                for (int t = 0; t < 25; t++)
41.                {
42.                    if (ch1[k] == letters[t] && flag[t] == 0)
43.                    {
44.                        ch[i][j] = letters[t];
45.                        flag[t] = 1;
46.                        if (j < 4)j++;
47.                        else { i++; j = 0; }
48.                    }
49.                }
50.            }
51.            for (int k = 0; k < 25; k++)//按字母表顺序把未用字母依次填入到矩阵中
52.            {
53.                if (flag[k] == 0)
54.                {
55.                    ch[i][j] = letters[k];
56.                    flag[k] = 1;
57.                    if (j < 4)j++;
58.                    else { i++; j = 0; }
59.                }
60.            }
61.            cout << "密钥填充后的矩阵为: " << endl;
62.            for (i = 0; i < 5; i++)
63.                for (j = 0; j < 5; j++)
64.                {
65.                    cout << ch[i][j];
66.                    cout << " ";
67.                    if (j == 4)
68.                        cout << endl;
69.                }
70.            cout << endl;
71.            cout << "请输入明文(请输入英文字符):";
72.            cin >> ch2;
73.            cout << "输入一个无关字符:";
74.            cin >> ch4;
75.            if (ch4 >= 'a')
76.                ch4 = ch4 - len;
77.            for (int k = 0; k < strlen(ch2); k++)//把所输入的明文转化为大写字母
78.            {
79.                if (ch2[k] >= 'a')
80.                    ch2[k] = ch2[k] - len;
81.            }
82.            for (int k = 0; k < strlen(ch2); k++)//把明文中的J都变为I
83.            {
84.                if (ch2[k] == 'J')
85.                    ch2[k] = 'I';
86.            }
87.            //为明文添加必要的无关字符以防止同一组的两个字符相同
88.            for (int k = 0; k < strlen(ch2); k += 2)
89.            {
90.                if (ch2[k] == ch2[k + 1])
91.                {
92.                    for (int t = strlen(ch2); t > k; t--)
93.                        ch2[t + 1] = ch2[t];
94.                    ch2[k + 1] = ch4;
95.                }
96.            }
97.            //若明文有奇数个字符,则添加一个无关字符以凑够偶数个
98.            if (strlen(ch2) % 2 != 0)
99.            {
100.                ch2[strlen(ch2) + 1] = ch2[strlen(ch2)];//字符串结尾赋'\0'
101.                ch2[strlen(ch2)] = ch4;//明文串尾插入无关字符
102.            }
103.            cout << "经过处理后的明文为:";
104.            for (int k = 0; k < strlen(ch2); k += 2)
105.                cout << ch2[k] << ch2[k + 1] << " ";
106.            cout << endl;
107.            cout << "其最终长度为:" << strlen(ch2) << endl;
108.            //明文输入并整理完毕///
109.            for (int k = 0; k < strlen(ch2); k += 2)
110.            {
111.                int m1, m2, n1, n2;
112.                for (m1 = 0; m1 <= 4; m1++)
113.                {
114.                    for (n1 = 0; n1 <= 4; n1++)
115.                    {
116.                        if (ch2[k] == ch[m1][n1])break;
117.                    }
118.                    if (ch2[k] == ch[m1][n1])break;
119.                }
120.                for (m2 = 0; m2 <= 4; m2++)
121.                {
122.                    for (n2 = 0; n2 <= 4; n2++)
123.                    {
124.                        if (ch2[k + 1] == ch[m2][n2])break;
125.                    }
126.                    if (ch2[k + 1] == ch[m2][n2])break;
127.                }
128.                m1 = m1 % 5;
129.                m2 = m2 % 5;
130.                if (n1 > 4) { n1 = n1 % 5; m1 = m1 + 1; }
131.                if (n2 > 4) { n2 = n2 % 5; m2 = m2 + 1; }
132.                if (m1 == m2)
133.                {
134.                    ch2[k] = ch[m1][(n1 + 1) % 5];
135.                    ch2[k + 1] = ch[m2][(n2 + 1) % 5];
136.                }
137.                else
138.                {
139.                    if (n1 == n2)
140.                    {
141.                        ch2[k] = ch[(m1 + 1) % 5][n1];
142.                        ch2[k + 1] = ch[(m2 + 1) % 5][n2];
143.                    }
144.                    else
145.                    {
146.                        ch2[k] = ch[m1][n2];
147.                        ch2[k + 1] = ch[m2][n1];
148.                    }
149.                }
150.            }
151.            cout << "加密后所得到的密文是:";
152.            for (int k = 0; k < strlen(ch2); k += 2)
153.                cout << ch2[k] << ch2[k + 1] << " ";
154.            cout << endl;
155.        }
156.        else break;
157.    }
158.
159.}
160.
161.//解密算法
162.void decrypt()
163.{
164.    const int N = 100;
165.    char letters[26] = "ABCDEFGHIKLMNOPQRSTUVWXYZ";//用于填充矩阵
166.    int flag[25] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
167.    //标记字母是否已在矩阵中,与letters数组对应
168.    char ch[5][5];//5X5矩阵
169.    char ch1[N];//密钥
170.    char ch2[N];//密文
171.    int len = 'a' - 'A';
172.    int flg = 1;
173.    cout << "输入密钥:";
174.    cin >> ch1;
175.    while (flg == 1)
176.    {
177.        for (int i = 0; i < strlen(ch1); i++)//把所输入的密钥转化为大写字母
178.        {
179.            if (ch1[i] > 'z' || ch1[i] < 'a')
180.            {
181.                cout << "请重新选择操作:" << endl;
182.                flg = 0; break;
183.            }
184.            else
185.                ch1[i] = ch1[i] - len;
186.        }
187.        if (flg == 1)
188.        {
189.            for (int i = 0; i < strlen(ch1); i++)//把密钥中的J都变为I        
190.            {
191.                if (ch1[i] == 'J')ch1[i] = 'I';
192.            }
193.            int i = 0; int j = 0;
194.            //把密钥中的字母填入到矩阵中,并把该字母标记为已用
195.            for (int k = 0; k < strlen(ch1); k++)
196.            {
197.                for (int t = 0; t < 25; t++)
198.                {
199.                    if (ch1[k] == letters[t] && flag[t] == 0)
200.                    {
201.                        ch[i][j] = letters[t];
202.                        flag[t] = 1;
203.                        if (j < 4)j++;
204.                        else { i++; j = 0; }
205.                    }
206.                }
207.            }
208.            for (int k = 0; k < 25; k++)//按字母表顺序把未用字母依次填入到矩阵中
209.            {
210.                if (flag[k] == 0)
211.                {
212.                    ch[i][j] = letters[k];
213.                    flag[k] = 1;
214.                    if (j < 4)j++;
215.                    else { i++; j = 0; }
216.                }
217.            }
218.            cout << "密钥填充后的矩阵为: " << endl;
219.            for (i = 0; i < 5; i++)
220.
221.                for (j = 0; j < 5; j++)
222.                {
223.                    cout << ch[i][j];
224.                    cout << " ";
225.                    if (j == 4)
226.                        cout << endl;
227.                }
228.            cout << endl;
229.            // 矩阵生成完毕
230.            int f = 0;
231.            do {
232.                cout << "请输入密文(英文字符):";
233.                cin >> ch2;
234.                for (int k = 0; k < strlen(ch2); k++)//把所输入的密文转化为大写字母
235.                {
236.                    if (ch2[k] >= 'a')
237.                        ch2[k] = ch2[k] - len;
238.                }
239.                for (int k = 0; k < strlen(ch2); k++)//把密文中的J都变为I
240.                {
241.                    if (ch2[k] == 'J')ch2[k] = 'I';
242.                }
243.                for (int k = 0; k < strlen(ch2); k += 2)
244.                {
245.                    if (ch2[k] == ch2[k + 1])
246.                    {
247.                        cout << "同一分组中不能出现相同字符!请重新输入。" << endl;
248.                        f = 1;
249.                        break;
250.                    }
251.                    else f = 2;
252.                }
253.                if (f == 1)continue;
254.                if (strlen(ch2) % 2 != 0)
255.                {
256.                    cout << "字符串不能为奇数个!请重新输入。" << endl;
257.                    f = 1;
258.                }
259.                else f = 2;
260.            } while (f == 1);
261.            //解密开始
262.            for (int k = 0; k < strlen(ch2); k += 2)
263.            {
264.                int m1, m2, n1, n2;
265.                for (m1 = 0; m1 <= 4; m1++)
266.                {
267.                    for (n1 = 0; n1 <= 4; n1++)
268.                    {
269.                        if (ch2[k] == ch[m1][n1])break;
270.                    }
271.                    if (ch2[k] == ch[m1][n1])break;
272.                }
273.                for (m2 = 0; m2 <= 4; m2++)
274.                {
275.                    for (n2 = 0; n2 <= 4; n2++)
276.                    {
277.                        if (ch2[k + 1] == ch[m2][n2])break;
278.                    }
279.                    if (ch2[k + 1] == ch[m2][n2])break;
280.                }
281.                m1 = m1 % 5;
282.                m2 = m2 % 5;
283.                if (n1 > 4) { n1 = n1 % 5; m1 = m1 + 1; }
284.                if (n2 > 4) { n2 = n2 % 5; m2 = m2 + 1; }
285.                if (m1 == m2)
286.                {
287.                    ch2[k] = ch[m1][(n1 + 4) % 5];
288.                    ch2[k + 1] = ch[m2][(n2 + 4) % 5];
289.                }
290.                else
291.                {
292.                    if (n1 == n2)
293.                    {
294.                        ch2[k] = ch[(m1 + 4) % 5][n1];
295.                        ch2[k + 1] = ch[(m2 + 4) % 5][n2];
296.                    }
297.                    else
298.                    {
299.                        ch2[k] = ch[m1][n2];
300.                        ch2[k + 1] = ch[m2][n1];
301.                    }
302.                }
303.            }
304.            cout << "解密后所得到的明文是:";
305.            for (int k = 0; k < strlen(ch2); k += 2)
306.                cout << ch2[k] << ch2[k + 1] << " ";
307.            cout << endl;
308.        }
309.        else break;
310.    }
311.
312.}
313.
314.int main()
315.{
316.
317.    int n;
318.    cout << "请选择1加密2解密:" << endl;
319.    while (true)
320.    {
321.        cin >> n;
322.        switch (n)
323.        {
324.        case 1:
325.            encrypt();
326.            break;
327.        case 2:
328.            decrypt();
329.            break;
330.        default:
331.            break;
332.        }
333.    }
334.    return 0;
335.}
336.

三、Given the plain text{000102030405060708090A0B0C0D0E0F} and the key {010101010101010101010101010101011}:

a. Show the original contents of State, displayed as a 4 x 4 matrix.
00 01 02 03
04 05 06 07
08 09 0A 0B
0C 0D 0E 0F
b. Show the value of State after initial AddRoundKey.
01 00 03 02
05 04 07 06
09 08 0B 0A
0D 0C 0F 0E
c. Show the value of State after SubBytes.
7C 63 7B 77
6B F2 C5 6F
01 30 2B 67
D7 FE 76 AB

d. Show the value of State after ShiftRows.
7C 63 7B 77
F2 C5 6F 6B
2B 67 01 30
AB D7 FE 76
e. Show the value of State after MixColumns.
95 A2 B8 15
B5 0C 58 87
7E AA EF E6
50 12 E4 2E

#include<iostream>
1.using namespace std;
2.int StateMatrix[4][4];  // 状态矩阵
3.#define SIZE_M  4
4.#define SIZE_N 4
5.
6.int muti(int hex1, int hex2) {
7.
8. switch (hex1) {
9. case 0x01:
10.  return hex2;
11. case 0x02:
12.  if (hex2 >= 0x80) {
13.   hex2 = hex2 << 1;
14.   hex2 = hex2 % 32;
15.   hex2 ^= 0x1b;
16.  }
17.
18.  else {
19.   hex2 = hex2 << 1;
20.   //hex2 = hex2 %16;
21.  }
22.
23.  return hex2;
24. case 0x03:
25.  return muti(0x01, hex2) ^ muti(0x02, hex2);
26.
27. }
28. printf("出错啦!");
29. return -1;
30.
31.}
32.
33.int main() {
34.
35. //int matrix_a[SIZE_M][SIZE_N] = { {0x02,0x03,0x01,0x01},{0x01,0x02,0x03,0x01},{0x01,0x01,0x02,0x03},{0x03,0x01,0x01,0x02} };//a
36. //int matrix_b[SIZE_N][SIZE_S] = { {0x7C,0x63,0x7B,0x77},{0xF2,0xC5,0x6F,0x6B},{0x2B,0x67,0x01,0x30},{0xAB,0xD7,0xFE,0x76 } };//b
37.
38.
39. int input[SIZE_M][SIZE_N]= { {0x7C,0x63,0x7B,0x77},{0xF2,0xC5,0x6F,0x6B},{0x2B,0x67,0x01,0x30},{0xAB,0xD7,0xFE,0x76 } };
40.
41.
42.
43. for (int i = 0; i < 4; i++)
44.
45.
46.  for (int j = 0; j < 4; j++) {
47.
48.   StateMatrix[i][j] = input[i][j];
49.
50.  }
51.
52.
53. int d0, d1, d2, d3;
54.
55. for (int i = 0; i < 4; i++) {
56.
57.  d0 = muti(0x02, StateMatrix[0][i]) ^ muti(0x03, StateMatrix[1][i]);
58.
59.  d0 ^= muti(0x01, StateMatrix[2][i]) ^ muti(0x01, StateMatrix[3][i]);
60.
61.  d1 = muti(0x01, StateMatrix[0][i]) ^ muti(0x02, StateMatrix[1][i]);
62.
63.
64.  d1 ^= muti(0x03, StateMatrix[2][i]) ^ muti(0x01, StateMatrix[3][i]);
65.
66.
67.  d2 = muti(0x01, StateMatrix[0][i]) ^ muti(0x01, StateMatrix[1][i]);
68.
69.  d2 ^= muti(0x02, StateMatrix[2][i]) ^ muti(0x03, StateMatrix[3][i]);
70.
71.
72.  d3 = muti(0x03, StateMatrix[0][i]) ^ muti(0x01, StateMatrix[1][i]);
73.
74.
75.  d3 ^= muti(0x01, StateMatrix[2][i]) ^ muti(0x02, StateMatrix[3][i]);
76.
77.
78.  printf("第%d列的结果是:\n%x %x %x %x\n", i, d0, d1, d2, d3);
79.
80.  StateMatrix[0][i] = d0;
81.
82.  StateMatrix[1][i] = d1;
83.
84.  StateMatrix[2][i] = d2;
85.
86.  StateMatrix[3][i] = d3;
87.
88. }
89.
90. return 0;
91.
92.}
93.

在这里插入图片描述
四、Compute the output of the MixColumns transformation for the following sequence of input bytes “67 89 AB CD.” Apply the InvMixColumns transformation to the obtained result to verify your calculations. Change the first byte of the input from “67” to “77" perform the MixColumns transformation again for the new input, and determine how many bits have changed in the output.
Note: You can perform all calculations by hand or write a program supporting these computations. If you choose to write a program, it should be written entirely by you;no use of libraries or public domain source code is allowed in this assignment.
28 05 2F 8A
在这里插入图片描述
08 15 3F BA
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/149119.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

快手旗下——Kolors模型部署与使用指南

以下是按照要求重写后的 Kolors 模型部署与使用指南&#xff0c;文章风格偏技术性&#xff0c;但保持简洁和易懂的特点&#xff1a; Kolors 模型部署与使用指南 一、Kolors 简介 Kolors 是由快手 Kolors 团队开发的文本到图像生成模型&#xff0c;基于大规模的潜在扩散技术。…

vue-animate-onscroll动画库(可来回触发动画)

效果展示 ①触发一次动画 触发一次 ②触发多次动画 触发多次 1.什么是vue-animate-onscroll 它是一个 Vue 插件&#xff0c;用于在滚动时触发动画效果。它可以帮助开发者在用户滚动页面时&#xff0c;逐渐展示元素&#xff0c;增强用户体验。基本用法是通过在元素上添加特定的指…

Soul APP创始人张璐团队探讨新世代婚恋观:基于兴趣爱好的“轻相亲”正逐渐流行

近年来,随着社会经济的快速发展和文化观念的不断演变,婚恋观念正在经历显著变化。为深入了解当代年轻人对婚恋的态度与趋势,Soul APP创始人张璐团队与上海大学社会学青年研究团队合作,联合发布了《2024年青年婚恋观念及趋势调查报告》(以下简称“报告”)。该报告基于Soul APP用…

qml PathView入门

PathView是一个用于在用户界面中沿着定义的路径显示和滚动项目的视图组件。它提供了丰富的定制选项&#xff0c;允许开发者创建复杂的动画效果和自定义的滚动行为&#xff0c;特别适用于需要展示非线性排列项目的场景&#xff0c;如图片轮播、自定义滚动菜单等。 一、主要属性 …

[教程]如何在iPhone上启用中国移动/联通/电信RCS消息

目前 苹果已经在 iOS 18 中带来 RCS 富媒体消息的支持&#xff0c;该消息基于网络传递&#xff0c;用户可以通过 RCS 免费将消息发送到其他 iPhone 或 Android 设备。在苹果面向测试版用户推出的 iOS 18.1 Beta 版中&#xff0c;中国网络运营商包括中国移动、中国联通、中国电信…

JavaSE - 面向对象编程05

01 正则表达式 【1】概念&#xff1a;正则表达式是由一些特定字符组成的&#xff0c;代表的是一个规则。 【2】可以用来做什么&#xff1f; ① 用于校验数据格式的合法性 ② 用于在文本中爬取满足要求的内容 ③ 用于String类的replace方法&#xff0c;split方法的替换和分割 …

【学习笔记】Linux系统基础知识3 —— cd命令详解

一、前期准备 1.已经正确安装并成功进入Linux系统 说明&#xff1a;本实验采用的 Redhat 系统&#xff08;因系统不一致&#xff0c;可能部分显示存在差异&#xff09; 二、学习内容 提示&#xff1a;学习Linux系统基础命令 cd 命令详解 1、cd命令 1. 功能说明 cd 命令用…

Simple Calculator(算法初阶,代码基础,“纯”手撕)

简单计算器&#xff1a;仅适用无括号加减乘除&#xff0c;算法初阶&#xff0c;代码基础&#xff0c;不调库或模块“纯”手撕。 (笔记模板由python脚本于2024年09月22日 12:08:02创建&#xff0c;本篇笔记适合喜欢用python解决实际问题的coder翻阅) 【学习的细节是欢悦的历程】…

Qt中多语言的操作(以QtCreator为例)

1、首先&#xff0c;我们在代码中与文本相关的且需要支持多语言的地方&#xff0c;用tr来包含多语言key&#xff08;多语言key是我们自己定义的&#xff09;&#xff0c;如下 //举例 QPushButton* btnnew QPushButton(this); btn->move(20,20); btn->resize(100,50); //…

在 deepin 上除了 Steam,还能怎么玩游戏?

查看原文 前段时间&#xff0c;很多朋友在 deepin 23 上实现了《黑神话&#xff1a;悟空》的通关&#xff0c;那么除了通过 Steam 玩 Windows 游戏之外&#xff0c;还有其他可以使用的游戏平台吗&#xff1f; 回答&#xff0c;当然是可以哒&#xff01; 游戏平台介绍 今天介…

RHCSA认证-Linux(RHel9)-Linux入门

文章目录 概要一、创建、查看和编辑⽂本1.1 输出重定向1.2 vim编辑器1.3 shell 变量1.5 获取帮助 二、管理本地用户和组2.1 描述用户2.2 切换用户和赋权2.3 用户管理2.4 用户组管理2.5 密码策略 三、控制文件访问3.1 列出文件和文件权限3.2 更改文件权限和拥有者3.3 控制默认权…

昆明理工大学MBA工商管理上课方式

--昆工MBA考研、管理与经济学院、125100工商管理、125602项目管理、199管理类综合能力、F009 政治、F008政治项目管理概论

有关在.Net Core中以TEXT类型将Json格式字段存到数据库的学习

导言 在写个值日接口时发现值日表中的值日时段是可以分多段的&#xff0c;想了想可以使用Json类型来存&#xff0c;不过之前没接触过在后端操作Json格式存到数据库的情况&#xff0c;之后学也了解到了一下方法来实现&#xff0c;故记录一下。 过程 从前端到后端再到数据库的 JS…

千亿大数据平台——MySQL大数据优化

一、自增量的作用 1. 唯一性标识 - 为表中的每一行数据提供一个唯一的、自动生成的标识符&#xff0c;确保数据的唯一性和准确性。 2. 简化数据关联 - 在多个表之间进行关联操作时&#xff0c;自增量字段可以作为便捷的关联键&#xff0c;方便建立和维护表之间的关系…

C#和数据库高级:虚方法

文章目录 一、抽象方法和抽象类中的思考1.1、回顾抽象方法的特点1.2、针对抽象方法问题的引出 二、虚方法的使用步骤2.1、虚方法重写方法的调用2.2、系统自带的虚方法2.3、重写Equals方法2.4、虚方法和抽象方法的比较 三、虚方法和抽象方法的联系3.1、ToString()方法的应用 一、…

字母与符号检测系统源码分享

字母与符号检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Computer V…

ChatGLM-6B-部署与使用

✨ Blog’s 主页: 白乐天_ξ( ✿&#xff1e;◡❛) &#x1f308; 个人Motto&#xff1a;他强任他强&#xff0c;清风拂山冈&#xff01; &#x1f4ab; 欢迎来到我的学习笔记&#xff01; 什么是ChatGLM-6B 一、简介 ChatGLM-6B 是由清华大学知识工程实验室&#xff08;KEG&…

Python:百度贴吧实现自动化签到

早知道&#xff0c;还是python。 Github项目仓库在这。 相关API 签到贴吧列表 签到分为两个接口&#xff0c;PC端签到一次经验2&#xff0c;而移动端签到则是一次经验6。该用哪个接口已经很明显了。不过这里还是列出PC端的签到API。 # PC端签到接口 # sign_url "https:…

时序预测 | Python实现KAN+LSTM时间序列预测

时序预测 | Python实现KAN+LSTM时间序列预测 目录 时序预测 | Python实现KAN+LSTM时间序列预测预测效果基本介绍程序设计预测效果 基本介绍 时序预测 | KAN+LSTM时间序列预测(Python) KAN作为这两年最新提出的机制,目前很少人用,很适合作为时间序列预测的创新点,可以结合…

python全栈开发《37.列表(元组)的count函数》

元组的count函数的功能和用法与列表的count函数完全一致。 1.count的功能 返回当前列表中某个成员的个数。 2.count的用法 fruits [苹果,西瓜,水蜜桃,西瓜,雪梨] count fruits.count(西瓜) print(count) 运行结果&#xff1a; 2 注意&#xff1a;列表的内置函数count拿到需要…