离散对数问题,英文是Discrete logarithm Problem,有时候简写为Discrete log,该问题是十几个开放数学问题(Open Problems in Mathematics, [0.a], [0.b])中的一个.为什么要从离散对数问题说起?因为后面的内容中会反复使用到,因此我们希望用独立的一节分析来消除理解上的不确定性. 0x01 背景 对数\(\log_{b}(a)\)是由John Napier发明(1614)的符号([1],[2.a],[2.b]),选择不同的基底,就…
Discrete Logarithm Problem 题目链接: http://acm.hust.edu.cn/vjudge/contest/127401#problem/D Description http://7xjob4.com1.z0.glb.clouddn.com/42600d1bedc3c308a68ea0453befd84e Input The first line of the input file contains a prime p, 1 < p < 2^13 . This…
题意:求一个x使得 a^x%p = b p为素数: 析:从1开始扫一下就好,扫到p-1就可以了,关键是这个题为什么要用文件尾结束,明明说是0,但是不写就WA... 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #incl…
https://vjudge.net/contest/317493#problem/I…
0x01 布尔代数(Boolean algebra) 大名鼎鼎鼎的stephen wolfram在2015年的时候写了一篇介绍George Boole的文章:George Boole: A 200-Year View. 怎样用数学公理重新表达经典逻辑?George Boole在19世纪的时候开始思考这件事,在他的书<The Mathematical Analysis of Logic>里面George Boole首次展示了使用符号加运算符的方式表示逻辑,例如"And"是&q…
0x01 从判定问题到形式语言 这篇讲知识证明的wiki([1]): https://en.wikipedia.org/wiki/Proof_of_knowledge 里面有一句话: Let x be a language element of language L in NP 这篇讲NPC的文章([2]) http://www.cs.princeton.edu/courses/archive/spr11/cos423/Lectures/NP-completeness.pdf 里面提到Decis…
什么是有限状态机(Finite State Machine)? 什么是确定性有限状态机(deterministic finite automaton, DFA )? 什么是非确定性有限状态机(nondeterministic finite automaton, NDFA, NFA)? [1] wiki-en: Finite state machine [2] wiki-zh-cn: Finite state machine [3] brilliant: finite-state-machines…
原文:wiki: 完美散列函数 假设,写一个SQL语句解析器,词法分析对SQL语句解析,把语句分成了多个token,一般这个时候会需要查询这个token是否是一个关键字token. 例如keywords表和tokens表分别如下: keywords = ["AS", "FROM", "INSERT", "SELECT", "WHERE"]; tokens = [As, From, Insert, Selec…
原题链接 额,一直在理解题意在纠结看不懂,后来才恍然大悟 题意:定义一种新运算 a × b = a * b mod p : 已知条件给定一个p 求 x 这里用到同余与模运算乘法公式:a * b % n = ( a % n ) * ( b % n ) % n :…
每次把新博客的链接分享到技术群里,我常常会附带一句:蚂蚁搬家.事实上也确实如此,坚持1篇1篇的把自己做过.思考过.阅读过.使用过的技术和教育相关的知识.方法.随笔.索引记录下来,并持续去改进它们,希望自己能有持续的学习成长,也希望对读者提供有效帮助.更重要的是,在博客上,逐渐获得了与许多老师.技术朋友.学生的交流,弥足珍贵.做一个索引,方便自己也方便需要的读者查阅.每篇博客,我都会尽可能去持续更新,流水不腐.户枢不蠹,这也是我喜欢在博客上持续记录的原因之一. 0x01 工具/技术 工具 工具(1…
第十一个知识点:DLP,CDH和DDH问题都是什么 这是第11篇也是数学背景的第二篇.主要关注群操作如何被用于设计密码基础. 就像你现在知道的那样,密码学经常依赖于'难问题'.这也就是说,如果我们假设对手不能在合适的时间内解决某个(数学)问题,那么我们设计的密码学协议的安全性就得到了证明.这篇推送介绍了安全证明中被广泛使用的三个这样的问题.对我来说很幸运,a)这只是群理论,不是计算机科学,同时b)两天前我参加了一个由Bristol Crypto研究员Susan Thomson主讲的客座讲座就是恰…
一.ECDSA概述 椭圆曲线数字签名算法(ECDSA)是使用椭圆曲线密码(ECC)对数字签名算法(DSA)的模拟.ECDSA于1999年成为ANSI标准,并于2000年成为IEEE和NIST标准.它在1998年既已为ISO所接受,并且包含它的其他一些标准亦在ISO的考虑之中.与普通的离散对数问题(discrete logarithm problem  DLP)和大数分解问题(integer factorization problem  IFP)不同,椭圆曲线离散对数问题(elliptic cur…
目录 简介 功能依赖 消息摘要算法 MD算法 家族发展史 应用场景 代码实现 MD5 示例代码 SHA算法 应用场景 代码实现 SHA1 SHA256 示例代码 MAC算法 HMAC算法的典型应用 HMAC算法的安全性 HMAC组合散列函数 代码实现 HMAC-MD5 HMAC-SHA1 HMAC-SHA256 示例代码 数字签名算法 Rivest-Shamir Adelman算法( RSA) 代码实现 SHA1WithRSA SHA256WithRSA 示例代码 数字签名算法(DSA) 代码实…
原文: Reed–Solomon codes for coders参考: AN2407.pdfWIKI: 里德-所罗门码实现:Pypi ReedSolo #译注:最近看到了RS码,发现还挺有意思的,找了一些资料学习了下,发现对于程序员来说,从这篇看起会比较容易.看完以后想着翻译一下试试,看看自己到底看懂了多少,于是就有了这篇.本文有部分错误,以及一些排版不对的地方,有兴趣的还是看原文更好:) 为程序员写的Reed-Solomon码解释 Reed-Solomon纠错码(以下简称RS码)广泛用于数据…
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki RECENT CHANGES: (16 Apr 2013) Added private derivation for i ≥ 0x80000000 (less risk of parent private key leakage) (30 Apr 2013) Switched from multiplication by IL to addition of IL (fas…
RSA,DSA,ECDSA,EdDSA和Ed25519的区别 用过ssh的朋友都知道,ssh key的类型有很多种,比如dsa.rsa. ecdsa.ed25519等,那这么多种类型,我们要如何选择呢? 说明 RSA,DSA,ECDSA,EdDSA和Ed25519都用于数字签名,但只有RSA也可以用于加密. RSA(Rivest–Shamir–Adleman)是最早的公钥密码系统之一,被广泛用于安全数据传输.它的安全性取决于整数分解,因此永远不需要安全的RNG(随机数生成器).与DSA相比,RS…
本节内容主要转载于:弄清楚DL,D-H,CDH problem,CDH assumption,DDH,BDDH,BCDH. DLP(Discrete Logarithm Problem) 在乘法群\((G,*)\)中: 离散对数问题:就是给出两个群元素\(P,Q\),求整数\(n\in Z_q^*\)是困难的,满足\(Q=P^n\) DH密钥交换协议 具体请参考:计算困难假设(Computational hardness assumption),DH密钥交换 基于DLP( 离散对数问题)的困难性…
官方:https://www.ssh.com/ssh/ The SSH protocol uses encryption to secure the connection between a client and a server. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network. 密钥类型包括rsa和dsa,…
Solved Pro.ID Title Ratio(Accepted / Submitted)   1001 fraction 辗转相除 4.17%(7/168) ok  1002 three arrays 字典树+贪心 12.69%(76/599)   1003 geometric problem 1.59%(1/63)   1004 equation 20.65%(310/1501)   1005 permutation 1 24.77%(407/1643)   1006 string ma…
In cryptography, forward secrecy (FS), also known as perfect forward secrecy (PFS), is a property of secure communication protocols in which compromises of long-term keys do not compromise past session keys . Forward secrecy protects past sessions ag…
General overview[edit]   Illustration of the idea behind Diffie–Hellman key exchange Diffie–Hellman key exchange establishes a shared secret between two parties that can be used for secret communication for exchanging data over a public network. The…
===========来自网友=========== “前向安全性”应当是叫做“forward security”.该定义最早是由Mihir Bellare和Sara K. Miner在 CRYPTO’99上提出的关于数字签名的性质[1].而“perfect forward secrecy”则是由Christoph G. Günther在EUROCRYPT ’89提出的,其最初用于定义会话密钥交换协议的一种安全性[2]. (Perfect)Forward secrecy的大致意思是:用来产生会话…
牛客第一场 (通过)Integration (https://ac.nowcoder.com/acm/contest/881/B) (未补)Euclidean Distance (https://ac.nowcoder.com/acm/contest/881/C) (未补)Parity of Tuples (https://ac.nowcoder.com/acm/contest/881/D) (已补)ABBA (https://ac.nowcoder.com/acm/contest/881/E)…
Description Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the discrete logarithm of N, base B, modulo P. That is, find an integer L such that B L  == N (mod P) Input Read several lines of…
3239: Discrete Logging Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 729  Solved: 485[Submit][Status][Discuss] Description Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 2 <= N < P, compute the discrete logar…
Discrete Logging Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 2831   Accepted: 1391 Description Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the discrete logarithm of N, b…
本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/转载请注明出处,侵权必究,保留最终解释权! Description Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the disc…
一文看懂:"边缘计算"究竟是什么?为何潜力无限? 转载cnbeta   云计算 雾计算 边缘计算...   知名创投调研机构CB Insights撰文详述了边缘计算的发展和应用前景.文章称,云计算已经不足以即时处理和分析由物联网设备.联网汽车和其他数字平台生成或即将生成的数据,这个时候边缘计算能够派上用场.该技术拥有着应用于诸多行业领域和发挥巨大作用的潜力.以下是文章主要内容: 有时更快的数据处理是一种奢侈——有时它生死攸关. 例如,自动驾驶汽车本质上是一台装有轮子的高性能计算机,它通…
POJ 2417 Discrete Logging Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4860   Accepted: 2211 Description Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the discrete logarith…
Discrete Logging Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 2819   Accepted: 1386 Description Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the discrete logarithm of N, b…