sha512

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 = "SHA512"

DriverName Specifies the specific identity of this driver within a group

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()

SetDefault will set THIS driver as the default encryption driver.

Types

type PwdSha512

type PwdSha512 struct {
	Salt string
	Cost int
}

PwdSha512 defines the values required for performing encryption

func New

func New() *PwdSha512

New creates a SHA512 encryption object. 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 verify credentials.

func (*PwdSha512) ComparePasswords

func (t *PwdSha512) ComparePasswords(hashedPassword, clearPassword, salt string) bool

ComparePasswords must check to see if the passed password is equal to the stored password

func (*PwdSha512) EncryptPassword

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

EncryptPassword will encrypt the password using the user's salt and our salt. This will be re-iterated for 'cost' number of times. This should be sufficient to protect it but still allow us to re-create later on. (The internal salt must never alter for the life of the record)

func (*PwdSha512) Id

func (t *PwdSha512) Id() string

Id returns the string identifier for this driver

func (*PwdSha512) LongHelp

func (t *PwdSha512) LongHelp() string

LongHelp returns a longer descriptive text for the help

func (*PwdSha512) Setup

func (t *PwdSha512) Setup(jsonOption string) encryption.EncryptDriver

Setup should be called when the driver has been selected for use. The options are cross-encryption.. See the encryption for what these are.

func (*PwdSha512) ShortHelp

func (t *PwdSha512) 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