Summary-of-Crypto-in-CTF(stream)
Stream Cipher - Many Time PadTheorem
流密钥循环使用
猜测密钥长度
Hamming Distance(二进制下两个等长字符串的比特位差异)
大小写英文字符两两的平均Hamming距离为2 ~ 3,而任意字符两两的平均Hamming距离为4
\therefore Assumed\quad c1=p1\oplus key,c2=p2\oplus key\\\\
...
About Knapsack
Basis基于子集和问题 - $a_{1}x_{1}+…+a_{n}x_{n}=E;\quad x_{i}\in\{0,1\}.$
Proved to be NP-hard.
但Merkle-Hellman cryptosystem存在trapdoor.
Merkle-Hellman cryptosystemKey-Generation
有随机超递增序列$w=(w_{1},w_{2},…,w_{n ...
Lattice-Learning-2
Chapter 3 Algorithm for the Closest and Shortest Vector Problems3.1 Babai’s Rounding TechniqueTheorem 3.1.1. Given a vector we can write $\underline{\omega}=\sum_{i=1}^{n}\alpha_{i}\underline{b_ ...
Lattice-Learning-1
Chapter 1 Lattice1.1 Basic Notions on LatticesDefinition 1.1.1. Let $\{\underline{b}_{1},…,\underline{b}_{n}\}$ be a linearly independent set of (row) vectors in $R^{m}(m\geq n)$. The lattice ge ...
Summary of Crypto in CTF(RSA)
RSA - How to Use opensslGiven flag.enc, pubkey.pem/pub.key
1openssl rsa -pubin -text -modulus -in warmup -in pubkey.pem
Then we get (e, n), after getting d:
1234from Crypto.Util.number import bytes_ ...
[ByteCTF2019] - boring_code
白盒审计
12345678910111213141516171819202122232425262728293031323334353637<?phpfunction is_valid_url($url) { if (filter_var($url, FILTER_VALIDATE_URL)) { if (preg_match('/data:\/\// ...