Giter Club home page Giter Club logo

aurelia's Introduction

Aurelia

About Aurelia

Aurelia is a function to hash password with HMAC (Hash-based message authentication code), PBKDF2 (Password-Based Key Derivation Function 2) and Random Bytes. The main reason to create this library is to make good hash for security reason and the hash must be:

  • Has a random salt every hash generation
  • Has a user unique hash so it will generate differently if the key and credential is different using HMAC
  • Has a unique signature for authentication using PBKDF2
  • Has a different hash value every generation but authenticable
  • Simple to authentication

This library is inspired by a post in crackstation about how to make secure hash here.

How to use

Here is a simple step to generate a hash:

import "github.com/kodefluence/aurelia"

func main() {
  credential := "credential"
  key := "key"

  fmt.Printf("Hashed: %s\n", aurelia.Hash(credential, key))
}

The hash result will be random every generation and the one of the result is:

AURELIA_4dd9b11ae216e0c231a330447adb8181f34ed8cd.1cace0ea1bca8bf2252b2b2a84148b630567772a.UC_46896b6a18f393cc6cbdf2664e0ba85ce7ba75db5d0e712eaedf690c337bfee2

Authentication is simply like this:

import "github.com/kodefluence/aurelia"

func main() {
  credential := "credential"
  key := "key"
  hashed := "AURELIA_BABLABLABLABLA"

  if aurelia.Authenticate(credential, key, hashed) {
    fmt.Println("Authentication success!")
  } else {
    fmt.Println("Authentication failed :(")
  }
}

That's it, have fun to use it! :)

Other Version

aurelia's People

Contributors

insomnius avatar

Stargazers

Januri D. P. avatar  avatar Arif Rakhman avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.