简体   繁体   English

填充oracle攻击-如何在python中将十六进制表示为一个字节

[英]padding oracle attack - how to represent hexadecimal as one byte in python

I am trying to carry out a padding oracle attack. 我正在尝试执行填充oracle攻击。 I am aware that I have to modify the bytes from 00 to the point where it succeeds, to find the correct padding. 我知道我必须将字节从00修改到成功的位置,以找到正确的填充。 But, how do I represent 00-FF in python? 但是,如何在python中表示00-FF? When I try representing it as a part of the string, 00 is taken as 2 bytes. 当我尝试将其表示为字符串的一部分时,00被视为2个字节。

PS - This is a homework problem. PS-这是一个作业问题。

执行'\\ x00 \\ x00 \\ xff'或“ 0000ff” .decode('hex')应该可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM