Skip to content

Instantly share code, notes, and snippets.

byronhe byronhe

View GitHub Profile
View ensure_single_process.cpp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
void ensure_single_process(const char * id){
struct sockaddr_un sun;
if(NULL==id || strlen(id)+1>sizeof(sun.sun_path)){
View https_client.php
<?php
$url="https://weixin.qq.com";
$url="https://www.alipay.com";
$url="https://www.baidu.com";
// Initialize session and set URL.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// Set so curl_exec returns the result instead of outputting it.
View scrypt_demo.cpp
#include <sodium.h>
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
/*
* reference:
* https://download.libsodium.org/doc/password_hashing/index.html
@byronhe
byronhe / ecdsa_demo.cpp
Created Aug 11, 2015
ecdsa key generate / sign / verify demo
View ecdsa_demo.cpp
#include <openssl/ecdsa.h>
#include <openssl/ecdh.h>
#include <openssl/evp.h>
#include <openssl/sha.h>
#include <openssl/bio.h>
#include <openssl/pem.h>
#include <iostream>
#include <string>
#include <cassert>
@byronhe
byronhe / modern_crypto.md
Last active Mar 16, 2019
现代密码学实践指南[2015年]
View modern_crypto.md

现代密码学实践指南[2015年]

标签(空格分隔): 密码学


本文介绍目前现代密码学的最先进技术, 前半部分主要翻译自 《Cryptographic Right Answers》,附上收集的资料,和byron个人的理解。

@byronhe
byronhe / rsa_oaep.go
Created May 22, 2015
rsa oaep 2048 sha256
View rsa_oaep.go
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"log"
)
func main() {
@byronhe
byronhe / patch_elf.cpp
Created Apr 2, 2014
replace a C function at runtime , for unit test。
View patch_elf.cpp
#include <stdint.h>
#include <iostream>
#include <string>
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include "patch_elf.h"
using namespace std;
You can’t perform that action at this time.