crypto

package
v0.0.0-...-f432f55 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptMessageWithPrivateKey

func DecryptMessageWithPrivateKey(packet, nonce, privKey, senderPubKey []byte) (string, bool)

DecryptMessageWithPrivateKey decrypts and verifies an encrypted message using the recipients private key

func DecryptPassphraseWithPassword

func DecryptPassphraseWithPassword(encryptedPassphrase, iv, salt, tag []byte, password string) (string, error)

DecryptPassphraseWithPassword decrypts the given encrypted passphrase with the password using AES-256-CBC

func EncryptMessageWithPrivateKey

func EncryptMessageWithPrivateKey(message string, privKey, recipientPubKey []byte) (packet []byte, nonce []byte)

EncryptMessageWithPrivateKey encrypts and authenticates a message for the given recipient's public key

func EncryptPassphraseWithPassword

func EncryptPassphraseWithPassword(passphrase, password string) (result, tag, iv, salt []byte, err error)

EncryptPassphraseWithPassword encrypts the given passphrase with the password using AES-256-CBC

func GetAddressFromPublicKey

func GetAddressFromPublicKey(publicKey []byte) string

GetAddressFromPublicKey takes a Lisk public key and returns the associated address

func GetBigNumberStringFromBytes

func GetBigNumberStringFromBytes(data []byte) string

GetBigNumberStringFromBytes returns the BigNumber representation of the bytes as string

func GetFirstEightBytesReversed

func GetFirstEightBytesReversed(bytes []byte) []byte

GetFirstEightBytesReversed returns the first 8 bytes of a byte slice in reversed order.

func GetPrivateKeyFromSecret

func GetPrivateKeyFromSecret(secret string) []byte

GetPrivateKeyFromSecret takes a Lisk secret and returns the associated private key

func GetPublicKeyFromSecret

func GetPublicKeyFromSecret(secret string) []byte

GetPublicKeyFromSecret takes a Lisk secret and returns the associated public key

func GetSHA256Hash

func GetSHA256Hash(stringToHash string) [sha256.Size]byte

GetSHA256Hash returns the SHA256 hash of a string as byte slice

func SignDataWithPrivateKey

func SignDataWithPrivateKey(data []byte, privKey []byte) []byte

SignDataWithPrivateKey takes data and a privateKey and returns a signature

func SignMessageWithPrivateKey

func SignMessageWithPrivateKey(message string, privKey []byte) []byte

SignMessageWithPrivateKey takes a message and a privateKey and returns a signature as hex string

func VerifyDataWithPublicKey

func VerifyDataWithPublicKey(data []byte, signature []byte, publicKey []byte) (bool, error)

VerifyDataWithPublicKey takes data, a signature and a publicKey and verifies it

func VerifyMessageWithPublicKey

func VerifyMessageWithPublicKey(message string, signature []byte, publicKey []byte) (bool, error)

VerifyMessageWithPublicKey takes a message, signature and publicKey and verifies it

Types

This section is empty.

Jump to

Keyboard shortcuts

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