Skip to content

Instantly share code, notes, and snippets.

View louismullie's full-sized avatar

L louismullie

View GitHub Profile
console.time('start');
# iPhone 5s
var clientKeypair = KEYUTIL.generateKeypair("EC", "secp224r1");
var pubKeyPEM = KEYUTIL.getPEM(clientKeypair.pubKeyObj);
var caPrvKey = KEYUTIL.generateKeypair("EC", "secp256r1").prvKeyObj;
var password = 'password';
console.time('start');
var certPEM = KJUR.asn1.x509.X509Util.newCertPEM(
<html>
<script type="text/javascript">
var Salsa20 = (function () {
function Salsa20(key, nonce) {
// Constants.
this.rounds = 20; // number of Salsa rounds
this.sigmaWords = [0x61707865, 0x3320646e, 0x79622d32, 0x6b206574];
@louismullie
louismullie / gist:9665360
Last active August 29, 2015 13:57
Installing Namecoin on Mac OS X
# 1. Install dependencies
brew install autoconf automake berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt
# 2. Checkout PR
git clone [email protected]:namecoin/namecoin.git
# Edit your .git/config file accordingly:
# https://gist.github.com/piscisaureus/3342247
@louismullie
louismullie / gist:9362140
Last active August 29, 2015 13:57
Ruby homework

Ruby homeworks

  1. Explain
{
  12345: ["trademark", 12]
}
@louismullie
louismullie / Fibonacci-ArnoldC
Last active November 1, 2016 12:12
Iterative Fibonacci in Arnold C (https://github.com/lhartikk/ArnoldC)
LISTEN TO ME VERY CAREFULLY FIBONACCI
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE n
HEY CHRISTMAS TREE x, y, i
YOU SET US UP x 0
YOU SET US UP y 1
YOU SET US UP i 0
BECAUSE I'M GOING TO SAY PLEASE LET OFF SOME STEAM BENNETT x 1
var credentials = {
username: "john",
password: "test"
};
App.createUser(credentials, success);
App = AirLock.initialize("client_secret");
@louismullie
louismullie / damgard-jurik.c
Created January 3, 2014 07:08
Damgård–Jurik cryptosystem in C (GPL)
/* Voting application based on the Damgard-Jurik cryptosystem
* Copyright (C) 2008-2010 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil, Switzerland
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
@louismullie
louismullie / openssl-ecc.m
Created December 11, 2013 01:44
OpenSSL ECC encrypt/decrypt
secure_t * ecies_encrypt(char *key, unsigned char *data, size_t length) {
void *body;
HMAC_CTX hmac;
int body_length;
secure_t *cryptex;
EVP_CIPHER_CTX cipher;
unsigned int mac_length;
EC_KEY *user, *ephemeral;
size_t envelope_length, block_length, key_length;