Documentation ¶
Index ¶
- func CreateAESCryptor(passphrase string, option ScryptOptions) (aesChacha2AEAD cipher.AEAD, err error)
- func Decrypt(encryptedSeed trinary.Trytes, passphrase string, options ScryptOptions) (tryteDecryptedSeed trinary.Trytes, err error)
- func Encrypt(seed trinary.Trytes, passphrase string, options ScryptOptions, ...) (result string, err error)
- func FindPowerOfNToughness(n int) (bits int, err error)
- func GenerateRandomBytes(n int) (b []byte, err error)
- func GenerateRandomSeed() (seed string, err error)
- func RandomPassphraseGenerator(n int) (stringBytes string, err error)
- func ToughnessSetting(n int) (toughness string, err error)
- type ScryptOptions
- type TryteEncryptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAESCryptor ¶
func CreateAESCryptor(passphrase string, option ScryptOptions) (aesChacha2AEAD cipher.AEAD, err error)
initialise Cipher with passphrase and options set in ScryptOptions struct
func Decrypt ¶
func Decrypt(encryptedSeed trinary.Trytes, passphrase string, options ScryptOptions) (tryteDecryptedSeed trinary.Trytes, err error)
Decrypt an Encrypted Tryte Seed
func Encrypt ¶
func Encrypt(seed trinary.Trytes, passphrase string, options ScryptOptions, toughnessInput int) (result string, err error)
Encrypt tryte string using AES the passphrase comes from scrypt, based on the SHA256 hash of the passphrase. takes seed Tryte, passphrase of any string, optional ScryptOptions struct Alternatively toughnessInput will calculate the required settings for AES
func FindPowerOfNToughness ¶
Calculate the number of bits based on user input that is greater than 0
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomSeed ¶
GenerateRandomSeed returns a securely generated string. It will return an error if a secure random int generator fails to function correctly
func ToughnessSetting ¶
Determine if the toughness level should be printed in the encrypted seed
Types ¶
type TryteEncryptor ¶
type TryteEncryptor interface{}