bcrypt

package
v0.0.0-...-51d629d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2016 License: BSD-3-Clause, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DriverName Specifies the specific identity of this driver within a group
	DriverName      = "bcrypt"
	IdentityStorage = "BCrypt"
	HelpShort       = "Standard high-quality encryption using BCRYPT methods"
	HelpTemplate    = `` /* 1020-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func Register

func Register()

Register is a simple wrapper to make sure registration occurs properly

func SetDefault

func SetDefault()

Types

type PwdBcrypt

type PwdBcrypt struct {
	Salt string
	Cost int
}

func New

func New() *PwdBcrypt

New will create a BCRYPT strucutre. The salt is given a static string but can be set up on selection from the driver. This must be the same with every load or you won't be able to login anymore.

func (*PwdBcrypt) ComparePasswords

func (t *PwdBcrypt) ComparePasswords(hashedPassword, clearPassword, userSalt string) bool

ComparePasswords must be called with a bcrypt password.

func (*PwdBcrypt) EncryptPassword

func (t *PwdBcrypt) EncryptPassword(clearPassword, userSalt string) string

EncryptPassword will encrypt the password using the magic number within the record. This should be sufficient to protect it but still allow us to re-create later on. (The magic number will never alter for the life of the record

func (*PwdBcrypt) Id

func (t *PwdBcrypt) Id() string

Id returns the string identifier for this driver

func (*PwdBcrypt) LongHelp

func (t *PwdBcrypt) LongHelp() string

LongHelp returns a longer descriptive text for the help

func (*PwdBcrypt) Setup

func (t *PwdBcrypt) Setup(jsonOptions string) encryption.EncryptDriver

Setup should be called only when the driver has been selected for use.

func (*PwdBcrypt) ShortHelp

func (t *PwdBcrypt) ShortHelp() string

ShortHelp returns a short string identifier for the identity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL