Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gehirninc/crypt
Pure Go crypt(3) Implementation
https://github.com/gehirninc/crypt
crypt go unix
Last synced: 1 day ago
JSON representation
Pure Go crypt(3) Implementation
- Host: GitHub
- URL: https://github.com/gehirninc/crypt
- Owner: GehirnInc
- License: bsd-2-clause
- Created: 2014-03-14T04:01:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-19T22:59:10.000Z (8 months ago)
- Last Synced: 2025-01-15T11:37:27.930Z (8 days ago)
- Topics: crypt, go, unix
- Language: Go
- Homepage:
- Size: 83 KB
- Stars: 76
- Watchers: 8
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Authors: AUTHORS.md
Awesome Lists containing this project
README
.. image:: https://travis-ci.org/GehirnInc/crypt.svg?branch=master
:target: https://travis-ci.org/GehirnInc/cryptcrypt - A password hashing library for Go
=========================================
crypt provides pure golang implementations of UNIX's crypt(3).The goal of crypt is to bring a library of many common and popular password
hashing algorithms to Go and to provide a simple and consistent interface to
each of them. As every hashing method is implemented in pure Go, this library
should be as portable as Go itself.All hashing methods come with a test suite which verifies their operation
against itself as well as the output of other password hashing implementations
to ensure compatibility with them.I hope you find this library to be useful and easy to use!
Install
-------To install crypt, use the *go get* command.
.. code-block:: sh
go get github.com/GehirnInc/crypt
Usage
-----.. code-block:: go
package main
import (
"fmt""github.com/GehirnInc/crypt"
_ "github.com/GehirnInc/crypt/sha256_crypt"
)func main() {
crypt := crypt.SHA256.New()
ret, _ := crypt.Generate([]byte("secret"), []byte("$5$salt"))
fmt.Println(ret)err := crypt.Verify(ret, []byte("secret"))
fmt.Println(err)// Output:
// $5$salt$kpa26zwgX83BPSR8d7w93OIXbFt/d3UOTZaAu5vsTM6
//
}Documentation
-------------The documentation is available on GoDoc_.
.. _GoDoc: https://godoc.org/github.com/GehirnInc/crypt