scrypt

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 4 Imported by: 0

README

Firebase scrypt

GoDoc Go Report Card Release MIT license

This is the golang implementation of the modified Scrypt algorithm used by Firebase Auth.

Sample
package main

import scrypt "github.com/Aoang/firebase-scrypt"

func main(){
	app, _ :=scrypt.New(
		"YE0dO4bwD4JnJafh6lZZfkp1MtKzuKAXQcDCJNJNyeCHairWHKENOkbh3dzwaCdizzOspwr/FITUVlnOAwPKyw==",
		"Bw==",
		8,
		14,
	)
	app.FirebaseVerify(
		"8x4WjoDbSxJZdR",
		"sPtDhWcd1MfdAw==",
		"xbSou7FOl6mChCyzpCPIQ7tku7nsQMTFtyOZSXXd7tjBa4NtimOx7v42Gv2SfzPQu1oxM2/k4SsbOu73wlKe1A==",
	)
}

Documentation

Overview

Package scrypt implements the modified Scrypt algorithm used by Firebase Auth.

Index

Constants

View Source
const (
	P      = 1
	KeyLen = 32
)

Variables

This section is empty.

Functions

func Key added in v1.1.0

func Key(password, salt []byte, signerKey, saltSeparator string, rounds, memCost, p, keyLen int) ([]byte, error)

Types

type App added in v1.1.0

type App struct {
	SignerKey     []byte
	SaltSeparator []byte
	Rounds        int
	MemCost       int
	P             int
	KeyLen        int
}

func New

func New(signerKey, saltSeparator string, rounds, memCost int) (*App, error)

func (*App) Encode added in v1.1.0

func (a *App) Encode(password, salt []byte) ([]byte, error)

func (*App) EncodeToString added in v1.1.0

func (a *App) EncodeToString(password, salt []byte) (string, error)

func (*App) FirebaseVerify added in v1.1.0

func (a *App) FirebaseVerify(password, salt, passwordHash string) bool

func (*App) Verify added in v1.1.0

func (a *App) Verify(password, salt []byte, passwordHash string) bool

Jump to

Keyboard shortcuts

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