alexandrevicenzi / Unchained
Licence: bsd-3-clause
Secure password hashers for Go compatible with Django
Stars: ✭ 46
Projects that are alternatives of or similar to Unchained
crypthash-net
CryptHash.NET is a .NET multi-target library to encrypt/decrypt/hash/encode/decode strings and files, with an optional .NET Core multiplatform console utility.
Stars: ✭ 33 (-28.26%)
Mutual labels: argon2, password, bcrypt
Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (+169.57%)
Mutual labels: password, bcrypt, argon2
bookshelf-secure-password
A Bookshelf.js plugin for handling secure passwords
Stars: ✭ 24 (-47.83%)
Mutual labels: password, bcrypt
BruteForce
A simple brute forcer written in GO for SHA1, SHA256, SHA512, MD5 and bcrypt
Stars: ✭ 49 (+6.52%)
Mutual labels: password, bcrypt
phc-crypto
Hashing algorithms simplified (supports Argon2, Bcrypt, Scrypt, and PBKDF2)
Stars: ✭ 22 (-52.17%)
Mutual labels: argon2, bcrypt
mongoose-pii
A Mongoose plugin that lets you transparently cipher stored PII and use securely-hashed passwords
Stars: ✭ 43 (-6.52%)
Mutual labels: password, bcrypt
FlashPaper
One-time encrypted password/secret sharing
Stars: ✭ 85 (+84.78%)
Mutual labels: password, bcrypt
Freeipa Password Reset
Self-service password reset app for FreeIPA
Stars: ✭ 44 (-4.35%)
Mutual labels: django, password
Upash
🔒Unified API for password hashing algorithms
Stars: ✭ 484 (+952.17%)
Mutual labels: password, bcrypt
Comeonin
Password hashing specification for the Elixir programming language
Stars: ✭ 1,166 (+2434.78%)
Mutual labels: bcrypt, argon2
CryptoKnight
CryptoKnight is a general purpose cryptography desktop app
Stars: ✭ 18 (-60.87%)
Mutual labels: password, bcrypt
hash-wasm
Lightning fast hash functions using hand-tuned WebAssembly binaries
Stars: ✭ 382 (+730.43%)
Mutual labels: argon2, bcrypt
Node Argon2
Node.js bindings for Argon2 hashing algorithm
Stars: ✭ 1,008 (+2091.3%)
Mutual labels: password, argon2
Sublimall Server
Server behind Sublimall SublimeText plugin
Stars: ✭ 43 (-6.52%)
Mutual labels: django
Django Rest Pandas
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)
Stars: ✭ 1,030 (+2139.13%)
Mutual labels: django
Unchained
Secure password hashers for Go compatible with Django Password Hashers.
Unchained can also be used to perform password validation against legacy or shared Django databases.
Install
Requires Go 1.9 or higher.
go get github.com/alexandrevicenzi/unchained
Supported Hashers
Hasher | Encode | Decode | Dependencies |
---|---|---|---|
Argon2 | ✔ | ✔ | golang.org/x/crypto/argon2 |
BCrypt | ✔ | ✔ | golang.org/x/crypto/bcrypt |
BCrypt SHA256 | ✔ | ✔ | golang.org/x/crypto/bcrypt |
Crypt | ✘ | ✘ | |
MD5 | ✔ | ✔ | |
PBKDF2 SHA1 | ✔ | ✔ | golang.org/x/crypto/pbkdf2 |
PBKDF2 SHA256 | ✔ | ✔ | golang.org/x/crypto/pbkdf2 |
SHA1 | ✔ | ✔ | |
Unsalted MD5 | ✔ | ✔ | |
Unsalted SHA1 | ✔ | ✔ |
Notes
Crypt support is not planned because it's UNIX only.
BCrypt hasher does not allow to set custom salt as in Django. If you encode the same password multiple times you will get different hashes. This limitation comes from golang.org/x/crypto/bcrypt library.
Examples
Encode password
package main
import "github.com/alexandrevicenzi/unchained"
func main() {
hash, err := unchained.MakePassword("my-password", unchained.GetRandomString(12), "default")
if err == nil {
fmt.Println(hash)
} else {
fmt.Printf("Error encoding password: %s\n", err)
}
}
Validate password
package main
import "github.com/alexandrevicenzi/unchained"
func main() {
valid, err := unchained.CheckPassword("admin", "pbkdf2_sha256$24000$JMO9TJawIXB1$5iz40fwwc+QW6lZY+TuNciua3YVMV3GXdgkhXrcvWag=")
if valid {
fmt.Println("Password is valid.")
} else {
if err == nil {
fmt.Println("Password is invalid.")
} else {
fmt.Printf("Error decoding password: %s\n", err)
}
}
}
License
BSD
Reference
Related Links
-
Django compatible signing for Go (
django.core.signing
)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].