Skip to content

Instantly share code, notes, and snippets.

@zhuzhuor
zhuzhuor / SPECK.c
Last active August 29, 2015 14:15
The block cipher SPECK128/128 written in one tweet
#include <stdio.h>
typedef unsigned long long u64;
#define R(x,y,k)x=x>>8|x<<56,x+=y,x^=k,y=y<<3|y>>61,y^=x
void SPECK(u64 *T,u64 *K){
for(int i=0;i<32;){
R(T[1],*T,*K);
R(K[1],*K,i++);
}}

Keybase proof

I hereby claim:

  • I am zhuzhuor on github.
  • I am zhuzhuor (https://keybase.io/zhuzhuor) on keybase.
  • I have a public key whose fingerprint is AD2C BB7B 6DE1 20B2 3CD3 0D05 8A26 7105 FF1F 6D51

To claim this, I am signing this object:

@zhuzhuor
zhuzhuor / run_script.bat
Created November 1, 2013 20:05
Batch file to run a Python script in the same folder
@ECHO off
set "script_path=%~dp0"
set "script_path=%script_path%my_script.py"
python %script_path% %*
@zhuzhuor
zhuzhuor / gen_exe.py
Created October 31, 2013 13:53
use py2exe to generate a standalone exe file from python script
import sys
try:
import py2exe
except:
raw_input('Please install py2exe first...')
sys.exit(-1)
from distutils.core import setup
import shutil
@zhuzhuor
zhuzhuor / SimSimiSimSimi.py
Created October 8, 2013 00:14
When SimSimi talks to SimSimi 小黄鸡逗小黄鸡
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import random
import requests
EN_URL = 'http://www.simsimi.com/func/req?lc=en&msg='
ZH_URL = 'http://www.simsimi.com/func/req?lc=ch&msg='
@zhuzhuor
zhuzhuor / simple.py
Last active December 20, 2015 14:48 — forked from veorq/simple.py
"""
This is an EXPERIMENTAL password hash with time and memory parameters,
such that the time parameter does not affect the memory required (but
does affect the number of memory accesses).
This was quickly designed, with no real test, so it's probably a silly
design and the code may be broken. Therefore, please:
- Do not use it to hash real passwords!
- Attack it! (circumvent the time/memory requirements, find biases...)
@zhuzhuor
zhuzhuor / 01-intro.md
Created June 25, 2013 03:16
[jist-example] for custom.css

Évariste Galois

Évariste Galois (French: [evaʁist ɡalwa]) (25 October 1811 – 31 May 1832) was a French mathematician born in Bourg-la-Reine. While still in his teens, he was able to determine a necessary and sufficient condition for a polynomial to be solvable by radicals, thereby solving a long-standing problem. His work laid the foundations for Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections. He was the first to use the word "group" (French: groupe) as a technical term in mathematics to represent a group of permutations. A radical Republican during the monarchy of Louis Philippe in France, he died from wounds suffered in a duel under questionable circumstances at the age of twenty.

@zhuzhuor
zhuzhuor / 01-intro.md
Last active December 18, 2015 22:38
[jist-example] for Markdown

Évariste Galois

Évariste Galois (French: [evaʁist ɡalwa]) (25 October 1811 – 31 May 1832) was a French mathematician born in Bourg-la-Reine. While still in his teens, he was able to determine a necessary and sufficient condition for a polynomial to be solvable by radicals, thereby solving a long-standing problem. His work laid the foundations for Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections. He was the first to use the word "group" (French: groupe) as a technical term in mathematics to represent a group of permutations. A radical Republican during the monarchy of Louis Philippe in France, he died from wounds suffered in a duel under questionable circumstances at the age of twenty.

@zhuzhuor
zhuzhuor / README.md
Last active December 18, 2015 20:59
[jist-example] for custom js
@zhuzhuor
zhuzhuor / blog1.md
Last active December 18, 2015 14:08
[jist-blog] This a post example with a tag