|
[转帖][转帖]今天看到一篇有意思的文章:程序员的十楼层。看看自己在第几层。
从学者这一层开始,已经不全属于计算机领域了。 |
|
[原创]XX委机要室过了的加密算法
这在150年前就被数学家发现了。 既然楼主都了解黎曼几何了,为什么还否定数学对于密码学的重要呢? 其实在我看来,没有哪门应用数学像密码学如此接近纯数学;近现代数学的辉煌成就(特别是20世纪对数学基础的认识),并没有因为新科技(例如计算机)的出现而有丝毫的褪色,相反,支撑新科技的基础却是数学;前人的认识确实不如现代人广,但聪明程度未必不如现代人;况且,密码学从杂耍到理论化,也就是近50年的事,计算机能破解杂耍的密码算法,但现代优秀的密码算法,破解不是靠计算机,而是数学。 |
|
|
|
[原创]The XOR Secret in Our Computer System
“对于随机A、B,A ⊕ B = (-A) ⊕ (-B)成立的概率(极限值)是1/3”证明如下: 设A、B低位有t个0,出现这个情况的概率为1/4^(t+1),故对于随机A、B,A ⊕ B = (-A) ⊕ (-B)成立的概率S = (1/4)^1 + (1/4)^2 + ... (1/4)^3 + ... = 1/3. |
|
[原创]The XOR Secret in Our Computer System
“A ⊕ B = (-A) ⊕ (-B)的充分必要条件是:A低位0的个数 = B低位0的个数”证明如下: 充分性:若A低位0的个数 = B低位0的个数,则A、B可表达如下: A = a*2^t,B = b*2^t,于是 A ⊕ B ⊕ (-A) ⊕ (-B) = (A ⊕ (~A + 1) ⊕ (B ⊕ (~B + 1)) = (a⊕~a⊕1)*2^t ⊕(b⊕~b⊕1)*2^t =((~1)*2^t )⊕((~1)*2^t ) = 0. 必要性:若A ⊕ B = (-A) ⊕ (-B),设A = a*2^t,B = b*2^s则由A ⊕ B ⊕ (-A) ⊕ (-B) = 0可以得出: ((~1)*2^t )⊕((~1)*2^s ) = 0,故t = s。 |
|
[原创]The XOR Secret in Our Computer System
"A、B为一奇一偶时, A ⊕ B = (-A) ⊕ (-B)一定不成立"证明如下: 若A ⊕ B = (-A) ⊕ (-B)成立,则A ⊕ B ⊕ (-A) ⊕ (-B) = 0;不妨设A为奇数,B为偶数,则: A ⊕ B ⊕ (-A) ⊕ (-B) = A ⊕ (-A) ⊕ B ⊕ (-B) = (A ⊕ ~A ) ⊕ 1 ⊕ (B ⊕ (~B + 1)) = ~(B ⊕ (~B + 1)⊕1) 将B表达成B = m*2^t,其中m为奇数,t>0;则~B + 1 = (~m)*2^t + (2^t - 1) + 1 = (~m)*2^t + 2^t = (~m+1) *2^t = (~m⊕1)*2^t; 故:A ⊕ B ⊕ (-A) ⊕ (-B) = ~((m*2^t) ⊕ ((~m⊕1)*2^t)⊕1) = ~((m⊕~m⊕1)*2^t ⊕ 1) = (2^t-1)*2 != 0 证毕。 上述证明同时也证明了A、B均为奇数时,A ⊕ B = (-A) ⊕ (-B),因为B为奇数,则t=0,(2^t-1)*2=0。 |
|
[求助]关于模的逆运算
首先需要判定该方程是否有解,判定方法通常采用欧几里得算法(也称辗转相除法),通常,也可以直接使用欧几里得算法求解,如果gcd(a,N)=1,也可以通过计算模幂得出x。 |
|
[求助]密码学的一个小问题
密码学其实是一门纯数学,如果说密码学与数论有关,想必没人会怀疑(想想RSA);而要更好的理解和研究数论,代数方法是不可少的;群环域这些,其实是抽象结构,并不是一个具体对象,许多数的集合,例如“模”,就可以使用群这个结构去研究它,这种研究会使得原来复杂的问题变得简单,并让你对“数集”的结构更为了解。 密码算法基本上都是在研究一种或多种“数集“的结构。 群论的”划时代意义“在于提供了一种全新的研究方法,相当于是为整个数学提供了一个新的方法论,极大的促进了数学的发展,其意义远远大于求解一元五次方程。 |
|
[求助]密码学的一个小问题
“试想:如果密钥可以通过安全信道进行传送,那为何还需要加密呢?直接将双方的通信信息(明文)也通过此信道传输,岂不可以省去加密和解密的繁琐操作,提高效率。” 物理上的安全信道往往资源受限或成本太高或使用不便,例如互联专线等,通常不适合大范围使用;非安全信道,通常就是公用信道,例如互联网,是指数据在该信道上的传输是透明的。 正是因为物理上建立安全信道的诸多不便,所以出现新的密码方法,这就是公钥密码。公钥密码的好处之一是能在公用信道上建立安全信道。 即使有安全信道,加解密也是必须的。所谓“秘密”,首先是信息,信息的基本属性就是传播,如果传播过程全是基于安全信道,那“秘密”也就不能称之为“秘密”。这也是“秘密”与普通信息的区别。 |
|
|
|
[原创]The XOR Secret in Our Computer System
以下结论也成立: 1、 A ⊕ B = (-A) ⊕ (-B)的充分必要条件是:A地位0的个数 = B低位0的个数。 2、对于随机A、B,A ⊕ B = (-A) ⊕ (-B)成立的概率(极限值)是1/3。 对于1,还需要证明A、B为一奇一偶时, A ⊕ B = (-A) ⊕ (-B)一定不成立; 对于2,直接利用1可以证明。 |
|
|
|
openssl 库的RSA算法问题
这是所有RSA都会出现的问题,但通常并不影响使用;RSA的消息填充规则可以保证消息值小于模数N. |
|
[原创]The XOR Secret in Our Computer System
楼主的想法,我想对于构造HASH碰撞很有意义。 |
|
[原创]The XOR Secret in Our Computer System
“當 A , B 都是 odd numbers 時, 則 A ⊕ B = (-A) ⊕ (-B)”很容易证明,只需要了解3点: 1、异或运算满足交换律和结合律(模2加运算,当然满足); 2、~X = X⊕ (111...11)2(模2加运算也是模2减运算); 3、当X是奇数时,-x = ~x⊕1(奇数特性)。 证明如下: (-A) ⊕ (-B) = ~A⊕1⊕~B⊕1 = ~A⊕~B = A⊕ (111...11)2⊕B⊕ (111...11)2 = A ⊕ B ; |
|
某公司笔试题目 求助
这是一个程序链接问题,与编译环境有关系,一般熟悉执行文件格式(例如PE或是ELF)就不难。 |
|
[求助]关于用Ms的CryptoAPI做RSA加密的疑问
从模幂的角度看待问题,不从加解密的角度看待问题,应该能实现你的需求。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值