go-argon2

Go bindings for Argon2

  • 所有者: tvdburgt/go-argon2
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

go-argon2

GoDoc

Go bindings for the reference C implementation of
Argon2, the winner of the
Password Hash Competition.

Installation

$ go get -d github.com/tvdburgt/go-argon2

This package depends on libargon2, specifically libargon2.so and argon2.h.
Make sure the library files are available in /usr:

$ git clone https://github.com/P-H-C/phc-winner-argon2.git argon2
$ cd argon2
$ git checkout tags/20171227 # switch to latest release
$ sudo make install

Test everything is installed correctly:

$ cd $GOPATH/src/github.com/tvdburgt/go-argon2/
$ go test

Usage

Raw hash with default configuration

hash, err := argon2.Hash(argon2.NewContext(), []byte("password"), []byte("somesalt"))
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%x\n", hash)

Encoded hash with custom configuration

ctx := &argon2.Context{
	Iterations:  5,
	Memory:      1 << 16,
	Parallelism: 2,
	HashLen:     32,
	Mode:        argon2.ModeArgon2i,
	Version:     argon2.Version13,
}

s, err := argon2.HashEncoded(ctx, []byte("password"), []byte("somesalt"))
if err != nil {
	log.Fatal(err)
}

fmt.Println(s)

主要指標

概覽
名稱與所有者tvdburgt/go-argon2
主編程語言Go
編程語言Go (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2016-01-10 20:51:20
推送於2018-11-09 17:53:42
最后一次提交2018-11-09 18:53:29
發布數0
用户参与
星數138
關注者數7
派生數13
提交數42
已啟用問題?
問題數9
打開的問題數2
拉請求數4
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?