# keygen

Package keygen is a helper to generate symmetric key(Ex: HMAC).

#### Create Symmetric Algorithm Key for HMAC SHA-256

    var err error
    size := 256  // Key size = 256 bits.
    key := make([]byte, size)

    if key, err = keygen.GenSymmetricKey(size); err != nil {
        fmt.Printf("GenSymmetricKey(%v) error: %v\n", size, err)
    }

    // Compare a zero-value byte array to see if key is generated.
    fmt.Printf("%v", !bytes.Equal(key, make([]byte, size)))

#### [CLI to generate symmetric key](https://github.com/northbright/keygen/tree/master/cli/gensymmetrickey)
* [gensymmetrickey](https://github.com/northbright/keygen/tree/master/cli/gensymmetrickey)

  * Generate symmetric key(Ex: HMAC).
  * Usage:  
      `gensymmetrickey -b=<key size in bits> -o=<output file>`
      
          Ex:
          gensymmetrickey -b=512 -o="mykey.dat"
          
  * [Binary Release](https://github.com/northbright/keygen/releases)

#### Documentation
* [API Reference](http://godoc.org/github.com/northbright/keygen)

#### License
* [MIT License](./LICENSE)

# keygen

keygen is a [Golang](http://golang.org) package which provides helper functions to generate symmetric key(Ex: HMAC).

#### Create Symmetric Algorithm Key for HMAC SHA-256

    var err error
    size := 256  // Key size = 256 bits.
    key := make([]byte, size)

    if key, err = keygen.GenSymmetricKey(size); err != nil {
        fmt.Printf("GenSymmetricKey(%v) error: %v\n", size, err)
    }

    // Compare a zero-value byte array to see if key is generated.
    fmt.Printf("%v", !bytes.Equal(key, make([]byte, size)))

#### [CLI to generate symmetric key](https://github.com/northbright/keygen/tree/master/cli/gensymmetrickey)
* [gensymmetrickey](https://github.com/northbright/keygen/tree/master/cli/gensymmetrickey)

  * Generate symmetric key(Ex: HMAC).
  * Usage:  
      `gensymmetrickey -b=<key size in bits> -o=<output file>`
      
          Ex:
          gensymmetrickey -b=512 -o="mykey.dat"
          
  * [Binary Release](https://github.com/northbright/keygen/releases)

#### Documentation
* [API Reference](http://godoc.org/github.com/northbright/keygen)

#### License
* [MIT License](./LICENSE)

Make it easy to understand what keygen is
Make it easy to understand what keygen is
