Skip to content

Instantly share code, notes, and snippets.

View KyCodeHuynh's full-sized avatar
💻
Software engineer

Ky-Cuong Huynh KyCodeHuynh

💻
Software engineer
View GitHub Profile
@KyCodeHuynh
KyCodeHuynh / mem_clr.c
Created May 30, 2017 04:48
How OpenSSL prevents memset() from being optimized out
/* Original: https://github.com/openssl/openssl/blob/2bcb232ebeb155c6f1241deb84a26ab23176f866/crypto/mem_clr.c */
/*
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#!/bin/bash
# Generate SHA-512 hashes of all PDF (or any other extension) files
for f in *.pdf
do
hash=`sha512sum $f`
echo "$f : $hash"
sha512sum $f >> "plaintext-file-hashes.txt"
done
"use strict";
/* ============================================================================
Gibson Research Corporation
UHEPRNG - Ultra High Entropy Pseudo-Random Number Generator
============================================================================
LICENSE AND COPYRIGHT: THIS CODE IS HEREBY RELEASED INTO THE PUBLIC DOMAIN
Gibson Research Corporation releases and disclaims ALL RIGHTS AND TITLE IN
THIS CODE OR ANY DERIVATIVES. Anyone may be freely use it for any purpose.
============================================================================
This is GRC's cryptographically strong PRNG (pseudo-random number generator)
@KyCodeHuynh
KyCodeHuynh / Bcrypt benchmark for Ruby.md
Last active June 4, 2016 18:25
Benchmark how long it takes to hash a password with Bcrypt in Ruby using a particular cost factor

Make sure that the bcrypt gem has been installed.

require 'Benchmark'
require 'bcrypt'
Benchmark.measure { BCrypt::Password.create('secret', :cost => 12) }