先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Python全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Python知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024c (备注Python)
正文
(
r
,
s
)
(r,s)
(r,s), and a public key
(
p
,
α
,
β
)
(p,\alpha,\beta)
(p,α,β), check whether the signature is valid or not.
Your program does the following:
- Generate a private key and the corresponding public key. Print the private key and the public key as multiple decimal strings.
- Read a decimal string representing a plaintext message
m
m
m. Raise an exception if
m
m
m is invalid.
- Sign the message
m
m
m. Print the signature
(
r
,
s
)
(r,s)
(r,s) as multiple decimal string.
- Verify the signature
(
r
,
s
)
(r,s)
(r,s) of message
m
m
m. Print valid
if the signature is valid. Print invalid
otherwise.
- Randomly pick a number as a faked message
m
′
m^\prime
m′, and verify the signature
(
r
,
s
)
(r,s)
(r,s) of message
m
′
m^\prime
m′. Print valid
if the signature is valid. Print invalid
otherwise.
- Randomly pick numbers as a faked signature
(
r
′
,
s
′
)
(r\prime,s\prime)
(r′,s′), and verify the signature
(
r
′
,
s
′
)
(r\prime,s\prime)
(r′,s′) of message
m
m
m. Print valid
if the signature is valid. Print invalid
otherwise.
Note that in this program, you may only include third-party codes or libraries for:
- Miller-Rabin Test
- finding a primitive root modulo prime p
- Extended Euclidean Algorithm
Example Input & Output
Input
4137696876930090267522398697653550193405311689664069574322834683213199126531348263326633721504049779673544721298253021191958429503842792929508773630980912
Output
Private Key:
p: 7623676177142273666176960941160763267715363061271226168423102803703307888568083070768414734233175022763592082166829461334117317633004076503299319393933531
alpha: 4852157426089893935411617364720859800493089641146556442371879299424783880014557103402720169349703681228223731146566716914079006206076028164786870639438634
a: 3378999248556716821986051126236329620786292051032565251155929677736759564488623249788309621451301313648501424873153999478194379023701985528788334198300666
Public Key:
p: 7623676177142273666176960941160763267715363061271226168423102803703307888568083070768414734233175022763592082166829461334117317633004076503299319393933531
alpha: 4852157426089893935411617364720859800493089641146556442371879299424783880014557103402720169349703681228223731146566716914079006206076028164786870639438634
beta: 900191922914835354062391486383477573543038624757518577920766087560733127924139275266000620349618745988286788581537670898557439116232221539792308522703996
Signature:
r: 6319172751757190059617527527206702628329370565289520380207782237638117089626184819108054497002450108714662052571938062244969670733303628072961698241980976
s: 4487722435787272797267428160768266252523442175017409508193970626399238483647311021229856082277095824456827558298764078442861955288380137538351154715433474
Verify (r,s) of m:
valid
m' (faked): 3794592956927179165727339787771495164761281462584199354337653233001069555811671313157589195265413704693831537814309912166154940955900923275208659567603551
Verify (r,s) of m':
invalid
r' (faked): 3159232051056019432416597255218241709553275595410987553313618304348446526218613835913933078438390905736100418385914557962667666159701449384865696308181869
s' (faked): 6724747854387400941199482927499544178640823360059844483666200355270210965256010155751083409193280897361331961705674904878262224584821396243969282511950802
Verify (r',s') of m:
invalid
solution code
import secrets
from random import randrange
import random
def is\_probably\_prime\_miller\_rabin(n: int, k: int = 10) -> bool:
# Miller-Rabin 素数判定
# https://gist.github.com/bnlucas/5857478
if n == 2 or n == 3:
return True
if not n & 1:
return False
def check(a: int, s: int, d: int, n: int) -> bool:
x = pow(a, d, n)
if x == 1:
return True
for _ in range(s - 1):
if x == n - 1:
return True
x = pow(x, 2, n)
return x == n - 1
s: int = 0
d: int = n - 1
while d % 2 == 0:
d >>= 1
s += 1
for _ in range(k):
a: int = randrange(2, n - 1)
if not check(a, s, d, n):
return False
return True
def get\_big\_prime(nbits: int = 512) -> int:
# http://ju.outofmemory.cn/entry/93761
# 返回一个可能是素数的大整数
while True:
p: int = 2 \*\* (nbits - 1) | secrets.randbits(nbits)
if p % 2 == 0:
p = p + 1
if is_probably_prime_miller_rabin(p):
return p
def KE\_create(min_num: int, max_num: int) -> int:
while 1:
prime_ran: int = random.randint(min_num, max_num)
if prime_ran % 2 == 0:
prime_ran += 1
if is_probably_prime_miller_rabin(prime_ran):
break
return prime_ran
# Extended Euclidean Algorithm
def ex\_gcd(a, b) -> tuple:
if b == 0:
return 1, 0, a
文末有福利领取哦~
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
👉**一、Python所有方向的学习路线**
Python所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照上面的知识点去找对应的学习资源,保证自己学得较为全面。![img](https://img-blog.csdnimg.cn/c67c0f87cf9343879a1278dfb067f802.png)
👉**二、Python必备开发工具**
![img](https://img-blog.csdnimg.cn/757ca3f717df4825b7d90a11cad93bc7.png)
👉**三、Python视频合集**
观看零基础学习视频,看视频学习是最快捷也是最有效果的方式,跟着视频中老师的思路,从基础到深入,还是很容易入门的。
![img](https://img-blog.csdnimg.cn/31066dd7f1d245159f21623d9efafa68.png)
👉 **四、实战案例**
光学理论是没用的,要学会跟着一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。**(文末领读者福利)**
![img](https://img-blog.csdnimg.cn/e78afb3dcb8e4da3bae5b6ffb9c07ec7.png)
👉**五、Python练习题**
检查学习结果。
![img](https://img-blog.csdnimg.cn/280da06969e54cf180f4904270636b8e.png)
👉**六、面试资料**
我们学习Python必然是为了找到高薪的工作,下面这些面试题是来自阿里、腾讯、字节等一线互联网大厂最新的面试资料,并且有阿里大佬给出了权威的解答,刷完这一套面试资料相信大家都能找到满意的工作。
![img](https://img-blog.csdnimg.cn/a9d7c35e6919437a988883d84dcc5e58.png)
![img](https://img-blog.csdnimg.cn/5db8141418d544d3a8e9da4805b1a3f9.png)
👉因篇幅有限,仅展示部分资料,这份完整版的Python全套学习资料已经上传
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**需要这份系统化的资料的朋友,可以添加V获取:vip1024c (备注python)**
![img](https://img-blog.csdnimg.cn/img_convert/6a448aa58fa0fe6fc21b778562ac5057.png)
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
面试资料相信大家都能找到满意的工作。
![img](https://img-blog.csdnimg.cn/a9d7c35e6919437a988883d84dcc5e58.png)
![img](https://img-blog.csdnimg.cn/5db8141418d544d3a8e9da4805b1a3f9.png)
👉因篇幅有限,仅展示部分资料,这份完整版的Python全套学习资料已经上传
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**需要这份系统化的资料的朋友,可以添加V获取:vip1024c (备注python)**
[外链图片转存中...(img-QVx6AEin-1713169705473)]
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**