passphrase

package
v0.0.0-...-f1d92c9 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

QuarkDash Passphrase Implementation

@git https://github.com/devsdaddy/quarkdash-go @version 1.2.1 @author Elijah Rastorguev @build 1023 @website https://dev.to/devsdaddy @updated 28.08.2026

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Argon2idSync

func Argon2idSync(passphrase string, salt []byte, memoryCost, timeCost, dkLen int) []byte

Argon2idSync - Argon2id-lite for string

func Argon2idSyncBytes

func Argon2idSyncBytes(passphrase, salt []byte, memoryCost, timeCost, dkLen int) []byte

Argon2idSyncBytes - Argon2id-lite for bytes

func DeriveKeyForQuarkDash

func DeriveKeyForQuarkDash(passphrase string, salt []byte, opts PassphraseOptions) (sessionKey, macKey []byte)

DeriveKeyForQuarkDash derive 64B (32B session + 32B MAC) for QuarkDash.

func DerivePassphrase

func DerivePassphrase(passphrase string, opts PassphraseOptions) (key, salt []byte)

DerivePassphrase - universal derive (pbkdf2/argon2id).

func GenerateSalt

func GenerateSalt(length int) []byte

GenerateSalt generates a salt with length (by default 32).

func PBKDF2Sync

func PBKDF2Sync(passphrase string, salt []byte, iterations, dkLen int) []byte

PBKDF2Sync - PBKDF2 for password string

func PBKDF2SyncBytes

func PBKDF2SyncBytes(passphrase, salt []byte, iterations, dkLen int) []byte

PBKDF2SyncBytes - PBKDF2 for bytes based password

Types

type PassphraseOptions

type PassphraseOptions struct {
	Salt       []byte
	Iterations *int
	MemoryCost *int
	TimeCost   *int
	KeyLength  *int
	Algorithm  string // "pbkdf2" or "argon2id"
}

PassphraseOptions - an options for passphrase

Jump to

Keyboard shortcuts

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