Skip to content

Instantly share code, notes, and snippets.

View quandqn's full-sized avatar

Quan Doan quandqn

  • Saigon, S. Vietnam
View GitHub Profile
@hellman
hellman / TwinPeaks2_slide_attack.py
Created October 22, 2018 06:37
NSUCRYPTO 2018 - Problem 4 - TwinPeaks2 - Slide attack
"""
Slide attack on the TwinPeaks2 cipher from NSUCRYPTO.
Disclaimer: this is not an optimal solution, just a proof-of-concept!
An actual solution is to note that Reverse(Encrypt(Reverse(x)) = Decrypt(x), where Reverse(a,b,c,d) = (d,c,b,a).
"""
from random import shuffle, randint
@hellman
hellman / 0_solve.py
Created September 10, 2017 18:42
ASIS CTF 2017 Finals - Marijuana (Crypto 394)
#-*- coding:utf-8 -*-
'''
In the challenge we are given a recently proposed cryptosystem
based on Mersenne primes ( https://eprint.iacr.org/2017/481 ).
The cryptosystem was broken quickly in https://eprint.iacr.org/2017/522.pdf
using random partitioning and LLL. Here this attack is implemented.
'''