class Sodium::Password::Key

Overview

See Sodium::Password::Key::Create

TODO Usage example using the same params with multiple passwords.

Defined in:

sodium/password/key.cr

Instance Method Summary

Instance methods inherited from class Sodium::Password::Abstract

mem : UInt64 mem, mem=(mem) mem=, ops : UInt64 ops, ops=(ops) ops=, random_salt random_salt

Class methods inherited from class Sodium::Password::Abstract

from_params(hash) from_params

Instance Method Detail

def derive_kdf(pass, *, salt = nil) : Kdf #

[View source]
def derive_key(pass : Bytes | String, key_bytes : Int32, *, salt : String | Bytes | Nil = nil) : SecureBuffer #

Must set a mode before calling.


[View source]
def mode : Mode #

Used by and must be set before calling #derive_key


[View source]
def mode=(mode : Mode) #

Used by and must be set before calling #derive_key


[View source]
def random_salt! #

[View source]
def salt : Bytes? #

[View source]
def salt=(salt : Bytes?) #

[View source]
def to_params(*, salt = nil, key_size = nil, tcost : Float64? = nil) #

[View source]