Skip to content

Instantly share code, notes, and snippets.

View ymg's full-sized avatar

Yasir Alguwaifli ymg

View GitHub Profile
@ymg
ymg / gist:8336460
Last active January 2, 2016 17:19
mozilla password hasher in go
/*
password hasher, follows the Mozilla security guide.
blog: https://blog.mozilla.org/webdev/2012/06/08/lets-talk-about-password-storage/
full guide: https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines#Password_Storage
*/
package main
import (
"code.google.com/p/go.crypto/bcrypt"
package main
import (
"encoding/json"
"fmt"
"time"
"github.com/garyburd/redigo/redis"
)
/*
password hasher, follows the Mozilla security guide.
blog: https://blog.mozilla.org/webdev/2012/06/08/lets-talk-about-password-storage/
full guide: https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines#Password_Storage
*/
package main
import (
"crypto/hmac"