Skip to content

Instantly share code, notes, and snippets.

View ShikChen's full-sized avatar
💤
Sleeping from home

ShikChen

💤
Sleeping from home
View GitHub Profile
@rkmylo
rkmylo / rfile_solution.py
Created May 22, 2017 00:36
RCTF 2017 - rFile Solution
from __future__ import division
import hashlib
import requests
from datetime import datetime, timedelta
api_url = 'http://rfile.2017.teamrois.cn/api/download/{}/{}'
def totimestamp(dt, epoch=datetime(1970,1,1)):
td = dt - epoch
return (td.microseconds + (td.seconds + td.days * 86400) * 10**6) / 10**6
@hellman
hellman / rsa_timing_attack_d_Montgomery.py
Created May 1, 2017 12:23
DEF CON 2017 Quals - Godzilla (Reverse/Crypto)
#-*- coding:utf-8 -*-
'''
DEF CON 2017 Quals - Godzilla (Reverse)
Timing attack on RSA decryption.
Based on http://www.cs.jhu.edu/~fabian/courses/CS600.624/Timing-full.pdf
Another solutions:
https://gist.github.com/nneonneo/367240ae2d8e705bb9173a49a7c8b0cd by b2xiao
https://gist.github.com/Riatre/caac24840b176cf843b3f66ad9a5eeaf by riatre
@hellman
hellman / bivariate_polynomial_modulo_N.py
Created April 24, 2017 13:53
PlaidCTF 2017 - Common (Crypto 600)
'''
Common-prime (in group order!) RSA with low private exponent.
p = 2ga + 1
q = 2gb + 1
N = p * q
phi(N) = 2gab
'''
from sage.all import *
@elliptic-shiho
elliptic-shiho / jochemsz_may.sage
Last active July 3, 2020 19:30
Plaid CTF 2017 Crypto 600pts - Common Solver (solved after CTF finished)
from sage.all import *
import itertools
# display matrix picture with 0 and X
# references: https://github.com/mimoo/RSA-and-LLL-attacks/blob/master/boneh_durfee.sage
def matrix_overview(BB, bound):
for ii in range(BB.dimensions()[0]):
a = ('%02d ' % ii)
for jj in range(BB.dimensions()[1]):
a += ' ' if BB[ii,jj] == 0 else 'X'
@hellman
hellman / supercomputer.py
Last active February 28, 2017 13:20
Boston Key Party CTF 2016 - Supercomputer
from sage.all import *
import re
active_bits = [
0, 3, 4, 7, 8, 9, 10, 11, 14, 20, 21, 24, 25, 26,
35, 40, 41, 43, 45, 46, 47,
]
code = """
#include <cassert>
#include <NTL/mat_GF2.h>
#include <NTL/GF2.h>
using NTL::GF2;
using NTL::mat_GF2;
using NTL::conv;
int g(GF2 x1, GF2 z1, GF2 x2, GF2 z2) {

CMAP2 Write-up

いま開催中のマラソンマッチ、c3.4xlarge(16コア)でストレージIOもありという環境での高速化コンテストだ。これは高速化を生業にしている某社のみなさまの出番では https://t.co/yIruowYFAI

— 今年は夏バテにならない (@tomerun) 2017年2月3日
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

ということで参加してました。

@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@hellman
hellman / generate.py
Created October 11, 2016 18:00
HITCON QUALS 2016 - Reverse (Reverse 500)
from binascii import crc32
def lcg_step():
global lcg
lcg = (0x5851F42D4C957F2D * lcg + 0x14057B7EF767814F) % 2**64
return lcg
def extract(val):
res = 32 + val - 95 * ((
((val - (0x58ED2308158ED231 * val >> 64)) >> 1) +