密码学
阅读《Python密码学》做的一些笔记,以及CTF比赛中用到的一些代码
禄潜
这个作者很懒,什么都没留下…
展开
-
How to encrypt and decrypt the Transportation Cipher with python(Ⅰ)
def main(): myMessage = 'Common sense is not so common.' myKey=8 ciphertext=encryptMessage(myKey,myMessage) print(ciphertext+'|')def encryptMessage(key,message): ciphertext=[''...原创 2020-04-28 11:49:43 · 204 阅读 · 0 评论 -
How to encrypt and decrypt the Caesar Cipher with python(Ⅱ)
上一篇文章中介绍了如何用python来解密凯撒密码,但是那是在已知密钥的情况下才可行的,大多数情况下我们是不知道加密所用的密钥,如果通过人力进行手工破解费时费力,而且极易可能出错,所以我们可以借助python来爆破。How to encrypt and decrypt the Caesar Cipher with python(Ⅰ)代码如下:message = 'GUVF VF ZL FRP...原创 2020-04-28 11:45:36 · 230 阅读 · 0 评论 -
How to encrypt and decrypt the Caesar Cipher with python(Ⅰ)
import pyperclipmessage='this is a message.'key=13mode='encrypt'LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'translated=''message=message.upper()for symbol in message: if symbol in LETTERS: ...原创 2020-04-27 22:09:27 · 167 阅读 · 0 评论 -
How to encrypt and decrypt the Reverse Cipher with python
message = 'Three can keep a secret, if two of them are dead.' translated = ''i = len(message) - 1 while i >= 0: translated = translated + message[i] i = i - 1 print(translated) 结果如下:...原创 2020-04-27 21:36:46 · 141 阅读 · 0 评论