Skip to content

Instantly share code, notes, and snippets.

@sh4dowb
sh4dowb / decrypt.py
Created September 17, 2021 19:41
Decrypt crypto-js default AES encryption with OpenSSL KDF in Python 3
# I absolutely hated crypto-js for this. non-standard configurations, weird algorithms, ...
# well obviously you can encrypt it with a better configuration which people will not
# go crazy figuring out its implementation, but in this case I wasn't encrypting the data.
import base64
from Crypto.Hash import MD5
from Crypto.Util.Padding import unpad
from Crypto.Cipher import AES
# generated using: CryptoJS.AES.encrypt('test 123456 plaintext', 'some password').toString()
@kazkansouh
kazkansouh / bleichenbacher.py
Created December 9, 2019 08:23
Classic Bleichenbacher RSA Padding Oracle Attack
#! /usr/bin/env python3
# Copyright (C) 2019 Karim Kanso. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@hyunsikjeong
hyunsikjeong / solver.sage
Created November 6, 2019 16:38
Multivariate Coppersmith method
class IIter:
def __init__(self, m, n):
self.m = m
self.n = n
self.arr = [0 for _ in range(n)]
self.sum = 0
self.stop = False
def __iter__(self):
return self
@arkadiyt
arkadiyt / cryptopals_set_8.md
Last active April 25, 2023 11:19
Cryptopals Set 8

Cryptopals is a set of cryptographic challenges, originally published here: https://cryptopals.com

Set 8 of the challenges was never published publicly, until late March 2018. However the cryptopals website was not updated to include the challenges. This gist compiles the 8th set of the Cryptopals challenges.

title link
57. Diffie-Hellman Revisited: Small Subgroup Confinement https://toadstyle.org/cryptopals/513b590b41d19eff3a0aa028023349fd.txt
58. Pollard's Method for Catching Kangaroos https://toadstyle.org/cryptopals/3e17c7b35fcf491d08c989081ed18c9a.txt
59. Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks https://toadstyle.org/cryptopals/a0833e607878a80fdc0808f889c721b1.txt
@yowu
yowu / HttpProxy.go
Last active April 27, 2024 20:17
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)

今天是 22 岁的最后一天。几个月前,我从沃顿商学院毕业,用文凭上“最高荣誉毕业”的标签安抚了已经年过半百的老妈,然后转头辞去了毕业后的第一份工作,跟一家很受尊敬的公司、还有 150 万的年薪道了别,回到了上海,加入了“刚毕业就失业”俱乐部,开始了一天三顿盒饭的新生活,中间许多精彩剧情暂时略过。  我肯定不是第一个做过这样事的人,也肯定不会是最后一个。所以在说自己的一些有趣故事前,我想借用大家(包括 30 岁甚至 40 岁以上的朋友)的一点时间和一点平和的心态,和大家分享过去一年以来一直没说的一些话。所以前两部说的是对于一些一直困扰着我们的关键词的理解和体会。他们是:欲望、外界、标签、天才、时间、经历、人生目标、后悔、和现实。

  这可能会是一篇科普文,也可能会是一篇长篇小说,但我不想这篇文章变成一篇励志文,大家都审美疲劳了。所以我想忽略阳春白雪,尽管信息量很大,但是至少说一些实实在在的经验和故事,说一些效果立竿见影的观点,再说说活捉林志玲什么的,总之让大家多看一点就多获得一点实际的价值。

第一部:那些最容易被理解错误的事

关于欲望