Lattice Based Crypto_1
格密码笔记一
Lattice based crypto基于一类新的难题——关于格(lattice)密码学
相比较于其他公钥密码学体系的优势:
加解密更快
可抵抗量子攻击1
1:量子攻击是什么?如何抵抗攻击? - 知乎 (zhihu.com)
一、“格”“格”,是一种与向量空间类似的数学空间。
实数空间 R 上的向量空间 V,是一些向量的集合;其中两个向量可以相加、向量可以和一个实数相乘,运算保持封闭。
也就是说,向量空间支持向量加法和标量乘法。而 lattice 与向量空间的区别,就是将标量乘法中的乘数,从实数改为整数。
格可以视为向量的集合,也可以视为点的集合。lattice 上的点排列非常整齐。
二、引例
一个公钥密码学方案
首先,Alice 选择一个大整数 q 作为公共参数。然后选择两个比较小的整数 f,g
满足$f<\sqrt{\frac{q}{2}},\sqrt{\frac{q}{4}}<g<\sqrt{\frac{q}{2}},gcd(f,qg)=1$
亦即 f 的长度大约小于$\frac{q}{2}$ 的一半,g 的长度大约在 $\fra ...
Lattice Based Crypto_4
格密码笔记四一、格
设$v_1,…,v_n∈R^m$ 是线性无关向量组。称 v1,…,vn 生成(generate) 了 lattice L:
$L={a_1v_1+a_2v_2+⋯+a_nv_n:a_1,a_2,…,a_n∈Z}$
即 L 中的元素是 $v_1,…,v_n$ 的整系数线性组合
基所包含的的向量个数称为 L 的纬度(dimension)
二、lattice 中基的关系
假设 $v1,…,v_n$ 是 lattice L 的一个基,而$ w_1,…,w_n$ 是 L 中的一个向量组。将 wj 表示成 vi 的线性组合:$w_1=a{11}v1+a{12}v2+⋯+a{1n}v_n$
$w2=a{21}v1+a{22}v2+⋯+a{2n}v_n$
⋮ ⋮
$wn=a{n1}v1+a{n2}v2+⋯+a{nn}v_n$
系数 $a_{ij}$ 全部是整数
用 $w_j$ 来组合出 $v_i$
U=\begin{pmatri ...
Lattice Based Crypto_2
格密码笔记二
背包密码(基于子集和问题)
NP完全(NP-complete)问题1
一、“背包(knapsack)”(一)子集和问题
给定一个正整数集合 $(M1,M2,…,Mn)$ 以及一个整数 S. 选择子集使其和等于 S.
例如:$M=(2,3,4,9,14,23),S=2$.。
我们选取子集 ${3,4,14}$,其和等于 21。
显然,子集和问题可能有唯一解,可能无解,可能多解。我们只考虑至少有一个解的情况。
接下来,我们利用子集和问题的困难性,构建一个公钥密码体系。
首先,取$M=(M1,M2,…,Mn)$为公钥。
Bob 要发送一条消息,将其编码为二进制向量 $x=(x1,x2,…,xn)$,(其中 xi 非 0 即 1)。
然后,Bob 计算$S=\sum^{n}_{i=1}x_iM_i$。
然后将 S 发送给 Alice。 而 Alice 想要解密,必须找到一个合法的 x,这也就相当于找到 M 的子集,使之和等于 S.
如果 Alice 能快速找到合法的 x 而敌手找不到,那么这个密码体系就是有效的,则Alice 解密与 Eve 解密的难度是一样的。
那接 ...
Term Plan 2_1
Term Plan
2022年8月27日-2023年1月7日
我这个人就是喜欢做计划(虽然计划赶不上变化)
To do list:1、竞赛与科研:
CTF练题(各种杂七杂八的比赛)
吃透常用公钥密码原理
熟练复现解题代码
数学建模
算法系统学习
模型系统学习
机器学习:
团队学习:
前端知识学习(js/vue…)
后端知识学习(pyqt5…)
bilibili网课
课题组学习:
模型检验代码
机器学习系统学习
2、课程学习
六级备考
《顾家北手把手教你雅思写作》
六级听力音频(百词斩)
六级词汇(百词斩)
阅读&翻译(先用雅思练手)
词汇积累
考研单词背诵(《恋练有词》)
课本单词背诵+练习(每周)
练字(英文&汉字)
阅读
《草木春秋》——汪曾祺
《我们时代的神经症人格》——卡伦·霍妮
作业+网课
TBC…
Summer Vacation Plan
Summer Vacation Plan
2022年6月30日-2022年8月18日
虽然有手写计划本,但由于修改、记录方便,在这写一个,方便计划实时修改(好看)。
To do list:1、竞赛与科研:
CTF练题(强网杯、网鼎杯备赛)
数学建模(国赛备赛)
机器学习:
团队学习:
Daily python( http://cryptopals.com )(速成)
bilibili网课(至少学到CNN_~p17~)
前端开发学习(参赛作品)
课题组学习:
《深度学习入门与实践》
研究转化关键代码
2、课内学习
六级备考
《顾家北手把手教你雅思写作》
六级听力音频(百词斩)
六级词汇(百词斩)
阅读&翻译(先用雅思练手)
词汇积累
考研单词背诵(《恋练有词》)
课本单词背诵+练习(每周)
练字(英文&汉字)
阅读
《草木春秋》——汪曾祺
《我们时代的神经症人格》——卡伦·霍妮
下学期课程预习(8月)
Machine Learning--courses
机器学习(machine learning)
机器学习就是自动找函式
speech recognition
image recognition
playing go
dialogue system
要找什么样的函式?
regression
输入以前数据,预测未来数据
pm2.5预测
binary classification
输入内容,输出yes/no
RNN:输入一个句子,输出pos/neg
multi-class classification
输入内容,选择正确选项
CNN:输入图片,输出类型
generation
产生有结构的复杂东西(文句、图片)
产生文句、产生二次元图像
如何告诉机器?
训练资料
supervised learning(label)(正确落子位置)
函式的loss(好坏)
reinforcement learning(AlphaGo)(自己学习)
unsupervised learning(无label)
机器如何找出所要的函式?
给定函式寻找范围 network architecture :RNN/CNN
函式寻找方 ...
AW-crypto_j
攻防世界-crypto一、base64
题目:Y3liZXJwZWFjZXtXZWxjb21lX3RvX25ld19Xb3JsZCF9
1、知识补充一、什么是Base64?百度百科中对Base64有一个很好的解释:“Base64是网络上最常见的用于传输8Bit字节码的编码方式之一,Base64就是一种基于64个可打印字符来表示二进制数据的方法”。
什么是“可打印字符”呢?为什么要用它来传输8Bit字节码呢?在回答这两个问题之前我们有必要来思考一下什么情况下需要使用到Base64?Base64一般用于在HTTP协议下传输二进制数据,由于HTTP协议是文本协议,所以在HTTP协议下传输二进制数据需要将二进制数据转换为字符数据。然而直接转换是不行的。因为网络传输只能传输可打印字符。什么是可打印字符?在ASCII码中规定,0-31、127这33个字符属于控制字符,32-126这95个字符属于可打印字符,也就是说网络传输只能传输这95个字符,不在这个范围内的字符无法传输。那么该怎么才能传输其他字符呢?其中一种方式就是使用Base64。
Base64,就是使用64个可打印字符来表示二进制数据的方 ...
AW-crypto_s_1
攻防世界-crypto一、sherlock
题目:附件下载下来,是英文原著小说,有几个大写的字母
1、知识补充用法: grep [选项]… 模式 [文件]…-E, —extended-regexp <模式> 是扩展正则表达式-o, —only-matching 只显示行中非空匹配部分[] #匹配一个指定范围内的字符,如’[Gg]rep’匹配Grep和grep。
用法:tr [选项]… SET1 [SET2]-d, —delete delete characters in SET1, do not translate
删除SET1中的字符,不进行翻译\n 换行
2、解答发现有重复出现的大写字母,且找几个看似乎是zero和one的重复出现。
在虚拟机利用命令
1cat 文件名 | grep -Eo '[A-Z]' |tr -d '\n'
将大写字母提取出来,如下:
1ZEROONEZEROZEROZEROZEROONEZEROZEROONEZEROZEROONEZEROZEROONEZEROONEZEROONEZEROONEZEROZE ...