网络安全 L2 Introduction to Cryptography 密码学

Definitions
1. crypto - hidden/secret + grafia - writing
2. “the science and study of secret writing”
3. Cryptography is the science of protecting data, which provides means of
converting data into unreadable form, so that
        1. the data cannot be accessed for unauthorised use
        2. the content of the data frames is hidden
        3. the authenticity of the data can be established
        4. the undetected modification of the data is avoided
        5. the data cannot be disowned by the originator of the message

Four goals of cryptography

1. Confidentiality - prevent unauthorised access;
2. Integrity - no modification of existing information;
3. Authentication - no identifying either entities or data origins;
4. Non-repudiation - preventing denials of messages sent

Goal 1: Confidentiality
1. This comprises two separate requirements:
        1. no observer can access the contents of the message.确保只有授权的接收者能够阅读或访问消息,防止未授权的第三方获取敏感信息。
        2. no observer can identify the sender and receiver.保护通信双方的身份信息,防止第三方知道谁在发送消息以及消息是发送给谁的。
2. The terms privacy or secrecy are also used to mean confidentiality

  • 隐私(Privacy):这个术语通常用于描述个人信息的保护,确保个人信息不被未授权的第三方获取或滥用。在信息安全的上下文中,隐私与保密性密切相关,因为它涉及到保护个人数据不被泄露。

  • 秘密(Secrecy):这个术语通常用于描述信息保持未知或不公开的状态。在信息安全中,秘密性是指确保信息不被未授权的实体所知晓,这与保密性的要求是一致的。

Goal 2: Integrity
1. This requires that the recipient can be sure that:
        1. the message has not been changed or lost during transmission.
        2. the message has not been prevented from reaching the recipient.
        3. the message has not reached the recipient twice. 

Goal 3: Authentication
1. This requires that:
        1. the sender can be sure that the message reaches the intended recipient, and only
the intended recipient, and
        2. the recipient can be sure that the message came from the sender and not an
imposter. The act by an imposter of sending such a message is referred to as “spoofing”

Goal 4: Non-repudiation
1. This requires that:
        1. the sender cannot deny that the message was sent by him.
        2. the recipient cannot deny that the message was received by him.

Terminology
1.
Plain text (or clear text) - text that can be read by a human
2.
Encryption - process of transforming plaintext into ciphertext
3.
Cipher text (or encrypted text) - text that needs to be processed to be read by a human being
4.
Decryption - process of transforming a cipher text into a plain text (the reverse of encryption)
5.
Cipher - a secret method of writing (i.e., encryption scheme: mathematical
function(s) or algorithm(s) used for encryption and decryption, they are usually using keys)
6.
Key - is a word, number, or phrase that is used to encrypt the clear text.

Conventional encryption model
1. A sender wants to send a “hello” message to a recipient:
        1. The original message (plaintext) is converted to ciphertext by using a key and an algorithm.
        2. The ciphertext is transmitted over the transmission medium.
        3. At the recipient end, the ciphertext is converted back to the original text using the
same algorithm and key that were used to encrypt the message.

Main cryptography techniques
1. Symmetric encryption:
        1. known as
secret key cryptography: Ɛk (PT) = CT, Dk (CT) = PT
        2. based on a
single key: the same key is used to encrypt and decrypt the data
2. Non-symmetric encryption:
1. known as
public key cryptography: Ɛk1(PT) = CT, Dk2 (CT) = PT
2. base on a combination of
two keys - secret key and public key.
3. public key is used for encryption, and
4. the secret key is used for decryption.

Symmetric encryption

• Main problem: the sender and the receiver have to agree on a common key, a
secure channel is also required exchange the secret key. 一个公钥加密和解密
• Most widely used secret key algorithms are DES, 3DES, AES.

Non-symmetric encryption

1. Non-symmetric: both keys are required to complete the process (encrypted by
the public key and decrypted by the private key).公钥加密 私钥解密
2. Widely used algorithm: RSA.

Traditional cryptographic techniques
1. Two basic components of classical ciphers:
substitution and transposition
        1. Substitution ciphers: letters are replaced by other letters
        2. Transposition ciphers: the letters are arranged in a different order
2. These ciphers may be:
        1.
Monoalphabetic - only one substitution/ transposition is used, or
        2.
Polyalphabetic - where several substitutions/ transpositions are used
3. Several such ciphers may be concatenated together to form a
product cipher.

Substitution cipher
1. Caesar (50-60BC) – monoalphabetic:
        1. ignore space character, gather letters in t-letter blocks
        2. rotate left or right by some number of positions to obtain cipher text.
        3. can describe this cipher as:
                1. Encryption Ɛk : i → i + k mod 26
                2. Decryption Dk : i → i − k mod 26

Substitution cipher (cont’d)
• Caesar cipher generalisation, keyword used to permute the alphabet:
• Write keyword (no repeat characters), suppose keyword is JACKSON, followed by
remainder of alphabet in order:
• What does your partner in crime need to encrypt/decrypt?
• just the keyword.
• How secure? i.e., how difficult to break?
• letter frequency analysis is a good attack.

1. Porta (1563) - monoalphabetic polygraphic:
        1. Replace 2-letter blocks with corresponding symbols
        2. The first letter (key) is stationary while the second letter moves, indicating which
symbol is to be used instead of the original 2-letter block.

  1. 加密/解密

    • 加密:使用固定的第一个字母作为键,将消息中的两个字母块替换为相应的符号。
    • 解密:使用相同的键和符号,将符号替换回两个字母的块,然后将块转换回字母。

1. Porta: A matrix can easily represent the original disc ...
2. The ’key’ for a porta cipher is a key word. e.g. ’FORTIFICATION’
3. To encipher a message, repeat the keyword above the plaintext. 

1. Vigenere (1553) – polyalphabetic:
        1. The message is encrypted using the original plain text, a (text) key, and the table

  • 多字母替换:与单字母替换密码(如凯撒密码)不同,维吉尼亚密码使用多个不同的替换表,每个替换表对应一个字母。
  • 关键词密钥:加密时使用一个关键词作为密钥,该关键词重复使用,直到覆盖整个明文。

Transposition cipher
1. Turning Grille (Fleissner, Wostrowitz 1881):
        1. This template was a square with a number of holes punched out.
        2. There are an even number of rows and columns (thus the total number of fields is divisible by 4).
        3. One fourth of these fields is cut out. This template is used for both encoding and
decoding the message.

  • 模板设计:模板是一个正方形,有偶数行和列,总的格子数可以被4整除。
  • 穿孔:模板上有四分之一的格子被剪掉,形成一个穿孔的网格。
  • 加密/解密:使用这个穿孔的网格模板来重新排列明文中的字母,形成密文。加密和解密使用同一个模板。

加密过程:

  1. 准备明文:将明文按照穿孔栅格的行数和列数排列,如果有必要,可以在明文下方添加空行,直到与模板的行数和列数相匹配。
  2. 放置模板:将模板放在明文上方,确保穿孔的网格覆盖明文。
  3. 填写密文:从左上角开始,将明文中的字母按照模板的穿孔位置填入密文中。如果模板的格子不够用,可以将明文分成多个部分,每部分使用一个模板。

解密过程:

  1. 准备密文:将密文按照穿孔栅格的行数和列数排列,如果有必要,可以在密文下方添加空行,直到与模板的行数和列数相匹配。
  2. 放置模板:将模板放在密文上方,确保穿孔的网格覆盖密文。
  3. 提取明文:从左上角开始,按照模板的穿孔位置提取字母,形成明文

 

 Encrypt JIM ATTACKS AT DAWN using this grille.

Product cipher
1. Feistel-IBM-1971:
        1. Predecessor for the Data Encryption Standard (DES).
        2. This system uses permutations (transpositions) on large blocks for the mixing
transformation, and substitution on small blocks for confusion.
        3. This system is based on two hardware components:
                1. P-box (Permutation box)
                2. S-box (Substitution box)

  • 混合变换:Feistel-IBM-1971系统使用置换(转置)操作来混合大块数据,并使用替换操作来增加混淆。
  • 基于硬件组件:这个系统基于两个硬件组件:
    • P-box(置换盒):P-box用于将输入数据块中的数据重新排列,以增加密文的随机性。
    • S-box(替换盒):S-box用于将输入数据块中的数据替换为不同的数据,以增加密文的复杂性。

加密过程:

  1. 初始置换:将明文数据块进行初始置换,以增加数据的随机性。
  2. 多轮加密:将数据块分成多个小块,每个小块都通过P-box和S-box进行加密。
  3. 输出:经过多轮加密后,将所有小块合并,形成最终的密文。

 Block ciphers
1. A type of symmetric-key encryption.
2. Transforms a fixed-length block of plaintext into a block of ciphertext of the
same length, using a user provided secret key.
3. Decryption is performed by applying the reverse transformation to the ciphertext block using the same secret key.
 4. The fixed length is called the block size, and for many block ciphers, the block size is 64 bits.

Stream ciphers
1. A stream cipher generates a keystream, a sequence of bits used as a key.
2. Encryption: accomplished by combining the keystream with the plaintext,
usually with the bitwise XOR operation.
3. The generation of the keystream can be independent of the plaintext and
ciphertext, termed as synchronous.
4. Or it can depend on the data and its encryption, termed as self-synchronising.
5. Most stream cipher designs are for synchronous stream ciphers.

Stream ciphers (cont’d)
1. A Vernam cipher is a stream cipher in which the plaintext is XORed with a
random or pseudorandom stream of data of the same length to generate the
ciphertext.
2. If the stream of data is truly random and used only once, then the cipher is a
one-time pad.

1. One Time Pad:
        1. The message is encrypted by combining (usually XORing) it with a perfectly random
key at least as long as the message and the key is only used once.
        2. Apart from the problem of obtaining a perfectly random key, the main problem with
one-time pads is the distribution of keys.

  1. 生成密钥:首先,需要一个与明文长度相等的随机密钥。这个密钥可以是一串随机生成的字符、数字或比特。
  2. 密钥与明文:将密钥与明文进行位对位的异或(XOR)操作。异或操作的性质是,任何数与自身异或的结果都是0,任何数与0异或的结果都是它本身。
  3. 生成密文:通过异或操作生成的结果就是密文。
  4. 使用相同的密钥:解密时,使用与加密时相同的随机密钥。
  5. 密钥与密文:将密钥与密文进行位对位的异或操作。
  6. 生成明文:通过异或操作,可以恢复出原始的明文。

Stream ciphers vs. block ciphers
1. Stream cipher:
        1. A type of symmetric encryption algorithm.
        2. Can be designed to be exceptionally fast, much faster than any block cipher.
        3. Typically operate on smaller units of plaintext, usually bits.
        4. The transformation of plaintext units will vary, depending on when they are
encountered during the encryption process.
2. Block cipher:
        1. Operate on large blocks of data.
        2. The encryption of any plaintext will result in the same ciphertext when the same
key is used.

Cryptographic modes
1. A block cipher encrypts a plain text in fixed-size n-bit blocks (often n = 64)
2. For messages exceeding n bit we can use four different modes of operation:
        1. ECB: Electronic Code Block.
        2. CBC: Cipher-Block Chaining.
        3. CFB: Cipher FeedBack.
        4. OFB: Output FeedBack.

Electronic code block
1. The message is divided into blocks and each block is encrypted separately:

 Cipher block-chaining

1. A plain text block is XORed with the previous cipher text block before
encryption.
2. The first plain text block is XORed with an Initializing Vector IV:Cipher FeedBack
1. Plain text is encrypted in blocks of size r (r < n).
2. The n-bit Shift Register (initially IV) is encrypted into an intermediate cipher
text.
3. The left-most r bits of the intermediate encrypted text are XORed with the next
r bits of the plain text to obtain r bits of cipher text.
4. The r bits of the final cipher text are moved to the right-most r bits of the Shift
Register and its r left-most bits are discarded.

Output FeedBack
1. Plain text is encrypted in blocks of size r (r < n);
2. The n-bit Shift Register (initially IV) is encrypted into an intermediate cipher
text;
3. The left-most r bits of the intermediate encrypted text are XORed with the next
r bits of the plain text to obtain r bits of cipher text;
4. The r bits of the intermediate cipher text are moved to the right-most r bits of
the Shift Register and its r left-most bits are discarded

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vue + Element UI table动态合并单元格

一、功能需求 1、根据名称相同的合并工作阶段和主要任务合并这两列&#xff0c;但主要任务内容一样&#xff0c;但要考虑主要任务一样&#xff0c;但工作阶段不一样的情况。&#xff08;枞向合并&#xff09; 2、落实情况里的定量内容和定性内容值一样则合并。&#xff08;横向…

9.11 QT ( Day 4)

一、作业 1.Widget.h #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QTimerEvent> //定时器类 #include <QTime> #include <QtTextToSpeech> //文本转语音类QT_BEGIN_NAMESPACE namespace Ui { class Widget; } QT_END_NAMESPACEcl…

杨氏矩阵中查找某个数字是否存在(不能使用遍历)

杨氏矩阵&#xff1a; 有一个数字矩阵&#xff0c;矩阵的每行从左到右是递增的&#xff0c;矩阵从上到下是递增的 如图所示&#xff1a; i为行&#xff0c;j为列 如果要找9&#xff0c;先从arr【0】【2】处开始找&#xff0c;3<9,i,排除第一行&#xff0c;6<9,i,排除第…

上海亚商投顾:沪指探底回升 华为产业链午后爆发

上海亚商投顾前言&#xff1a;无惧大盘涨跌&#xff0c;解密龙虎榜资金&#xff0c;跟踪一线游资和机构资金动向&#xff0c;识别短期热点和强势个股。 一.市场情绪 沪指昨日探底回升&#xff0c;深成指、创业板指盘中跌逾1%&#xff0c;午后集体拉升翻红。华为产业链午后走强…

B-树底层原理

一、B-树介绍 定义&#xff1a; B-树&#xff08;B-Tree&#xff09;是一种自平衡的树形数据结构&#xff0c;广泛应用于数据库和操作系统中。它的设计目标是减少搜索、顺序访问、插入和删除操作中比较次数和移动次数&#xff0c;特别适合于磁盘中数据的存储和检索。 性质&a…

RabbitMQ练习(AMQP 0-9-1 Overview)

1、What is AMQP 0-9-1 AMQP 0-9-1&#xff08;高级消息队列协议&#xff09;是一种网络协议&#xff0c;它允许遵从该协议的客户端&#xff08;Publisher或者Consumer&#xff09;应用程序与遵从该协议的消息中间件代理&#xff08;Broker&#xff0c;如RabbitMQ&#xff09;…

欺诈文本分类检测(十四):GPTQ量化模型

1. 引言 量化的本质&#xff1a;通过将模型参数从高精度&#xff08;例如32位&#xff09;降低到低精度&#xff08;例如8位&#xff09;&#xff0c;来缩小模型体积。 本文将采用一种训练后量化方法GPTQ&#xff0c;对前文已经训练并合并过的模型文件进行量化&#xff0c;通…

【电子通识】规格书上的%FS和%RD具体指什么?

在仪器仪表类的手册上&#xff0c;常见的精度表达规格显示方式&#xff1a;%FS 和%RD 究竟如何解读呢&#xff1f; 术语解说 %RD(Reading)&#xff1a;用于表示对比显示值(读值)存在多少(%)的误差 %FS(Full Scale)&#xff1a;用于表示对比全量程存在多少(%)的误差 %SP(Set Poi…

基于ssm+vue+uniapp的电影交流平台小程序

开发语言&#xff1a;Java框架&#xff1a;ssmuniappJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09;数据库工具&#xff1a;Navicat11开发软件&#xff1a;eclipse/myeclipse/ideaMaven包&#xff1a;M…

多文件编程实现链表创建,插入,输出(上)

linklist.c #include "linklist.h" //创建空的链表&#xff0c;为头结点在堆区分配空间 linklist_t *creat_empty_linklist() {linklist_t *head NULL;head (linklist_t *) malloc(sizeof(linknode_t));if(NULL head){printf("malloc is fail!\n");ret…

项目小结二()

一.个人信息的界面 这里可以进行用户信息的修改&#xff0c;并渲染数据上去 二.这两天&#xff0c;出现的问题&#xff1a; 1.mybatis中 字段取别名 &#xff08;还没验证&#xff0c;是否正确&#xff09; 问题描述&#xff1a;由于实体类中的变量名&#xff0c;与数据库中…

CTF—杂项题目

1.ctfshow-Misc入门-misc17 1 用010editer打开图片后没有直接搜到ctf&#xff1b; 2 用binwalk分析文件发现有一个bzip2的隐藏文件并将其分离&#xff1b; 3 得到一个压缩文件D86.bz2&#xff1b; 4 但使用解压命令进行解压时&#xff0c;显示文件受损&#xff1b; 5 参考别人…

SpringBoot学习(8)RabbitMQ详解

RabbitMQ 即一个消息队列&#xff0c;主要是用来实现应用程序的异步和解耦&#xff0c;同时也能起到消息缓冲&#xff0c;消息分发的作用。 消息中间件最主要的作用是解耦&#xff0c;中间件最标准的用法是生产者生产消息传送到队列&#xff0c;消费者从队列中拿取消息并处理&…

Docker高级管理--Compose容器编排与私有仓库(Docker技术集群与应用)

本文介绍了Docker的三大工具&#xff1a;Docker Machine用于创建和管理Docker主机&#xff0c;Docker Compose用于单引擎模式下的多容器应用部署和管理&#xff0c;而Docker Swarm则是一个集群管理工具&#xff0c;提供微服务应用编排功能。Docker Machine支持在不同环境配置Do…

技术成神之路:设计模式(十三)访问者模式

介绍 访问者模式&#xff08;Visitor Pattern&#xff09;是一种行为型设计模式&#xff0c;它允许你在不改变对象结构的前提下&#xff0c;定义作用于这些对象的新操作。这种模式通过将操作逻辑从对象结构中抽离出来&#xff0c;使得新的操作可以无缝地添加到现有对象中。 1.定…

PDF转Excel小达人养成记

在现代职场&#xff0c;数据管理与格式转换可谓是日常任务的重头戏&#xff1b;有时我们手头有一份PDF文件&#xff0c;但需要将其中的数据整理成Excel表格&#xff0c;这该如何是好&#xff1f;别急&#xff0c;今天我就来给大家介绍几款好用的PDF转Excel工具&#xff0c;以及…

【CanMV K230 AI视觉】 人体关键点检测

【CanMV K230 AI视觉】 人体关键点检测 人体关键点检测 动态测试效果可以去下面网站自己看。 B站视频链接&#xff1a;已做成合集 抖音链接&#xff1a;已做成合集 人体关键点检测 人体关键点检测是指标注出人体关节等关键信息&#xff0c;分析人体姿态、运动轨迹、动作角度等…

【python】OpenCV—Age and Gender Classification

文章目录 1、任务描述2、网络结构2.1 人脸检测2.2 性别分类2.3 年龄分类 3、代码实现4、结果展示5、参考 1、任务描述 性别分类和年龄分类预测 2、网络结构 2.1 人脸检测 输出最高的 200 个 RoI&#xff0c;每个 RoI 7 个值&#xff0c;&#xff08;xx&#xff0c;xx&#x…

chapter14-集合——(List-HashSet)——day18

目录 519-HashSet全面说明 520-数组链表模拟 521-HashSet扩容机制 重要 522-HashSet源码解读1 526-HashSet最佳实践 527-hashSet思考题 519-HashSet全面说明 题一、 两个tom都可以添加成功是因为这是两个对象 看源码做分析&#xff1a;不是直接指向常量池的吗&#xff1f;…

【Python篇】matplotlib超详细教程-由入门到精通(下篇)

文章目录 前言第六部分&#xff1a;保存与导出图表6.1 保存为图片文件示例&#xff1a;保存图表为 PNG 文件解释&#xff1a;关键点&#xff1a; 6.2 保存为高分辨率图片示例&#xff1a;保存为高分辨率图片解释&#xff1a; 6.3 保存为不同文件格式示例&#xff1a;保存为不同…