Skip to content

Instantly share code, notes, and snippets.

@Sachin-A
Sachin-A / argon2.md
Last active October 26, 2016 09:11
Overview of Argon2: A memory hard function for password hashing

Argon2

  • Argon2 is a key derivation function that was selected as the winner of the Password Hashing Competition in July 2015. It was designed by Alex Biryukov, Daniel Dinu, and Dmitry Khovratovich from University of Luxembourg.
  • It uses the BLAKE2 hash algorithm to securely scramble input data (password and salt).

Introduction

Problems with existing designs

  • Should the memory addressing (indexing functions) be input-independent or input-dependent, or hybrid?
  • Is it better to fill more memory but suffer from time-space tradeoffs, or make more passes over the memory to be more robust?
  • How should the input-independent addresses be computed? Several seemingly secure options have been attacked.
@sooryan
sooryan / blake2.md
Last active March 12, 2024 02:37
A quick summary of blake2, a cryptographic hash function

BLAKE2

  • BLAKE2 is an improved version of the SHA-3 finalist BLAKE, and was designed by a team of experts in cryptanalysis, implementation, and cryptographic engineering; namely Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn and Christian Winnerlein.

  • BLAKE2s (the one checksum currently uses) computes a message digest that is 256 bits long, and represented as a 64-character hexadecimal number, e.g. 4264cb256d94533b6e152da59256638bc6adfda3efc5550d7607d4e6e45592fc.

Types

  • BLAKE2b (or just BLAKE2) is optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes.
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@karlcow
karlcow / mozilla-central.sublime-project
Last active August 29, 2015 14:23
sublime-text-config for mozilla-central
{
"folders": [{
"path": "/Users/karl/code/mozilla-central"
}],
"settings": {
"trim_trailing_white_space_on_save": false
},
}

Debian on ThinkPad W540

This is a short write-up of my experiences with installing Debian on a ThinkPad W540.

All commands should be run as root, unless indicated otherwise.

Table of Contents

Debian Install Notes

@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active May 26, 2024 17:26
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@parzonka
parzonka / getStackTrace.java
Created December 16, 2013 16:15
Gets the stack trace from the given throwable.
/**
* Gets the stack trace from the given throwable.
*
* @param throwable
* a throwable
* @return stack trace as string
*/
public static String getStackTrace(Throwable throwable) {
final StringWriter stringWriter = new StringWriter();
throwable.printStackTrace(new PrintWriter(stringWriter));
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active June 10, 2024 09:43
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@iheanyi
iheanyi / NowArrayAdapter.java
Last active February 10, 2019 17:32
Google Now Cards Layout XML. list_item.xml can be customized to your heart's content . . . Also, you can implement the following with DragSortListView for swiping to delete, reordering, and whatnot.
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@taxilian
taxilian / Factory.cpp
Created October 15, 2011 04:14
Example of adding a file-based logging method
#include <boost/filesystem.hpp>
#include "SystemHelpers.h"
using namespace boost::filesystem;
/// ...
void getLoggingMethods( FB::Log::LogMethodList& outMethods )
{
path appDataPath = FB::System::getLocalAppDataPath("CompanyName");