vault: Index | Files

package dhutil

import ""


Package Files


func DecryptAES Uses

func DecryptAES(key, ciphertext, nonce, aad []byte) ([]byte, error)

Use AES256-GCM to decrypt some ciphertext with a provided key and nonce. The returned values are the plaintext and error respectively.

func EncryptAES Uses

func EncryptAES(key, plaintext, aad []byte) ([]byte, []byte, error)

Use AES256-GCM to encrypt some plaintext with a provided key. The returned values are the ciphertext, the nonce, and error respectively.

func GeneratePublicPrivateKey Uses

func GeneratePublicPrivateKey() ([]byte, []byte, error)

generatePublicPrivateKey uses curve25519 to generate a public and private key pair.

func GenerateSharedKey Uses

func GenerateSharedKey(ourPrivate, theirPublic []byte) ([]byte, error)

generateSharedKey uses the private key and the other party's public key to generate the shared secret.

type Envelope Uses

type Envelope struct {
    Curve25519PublicKey []byte `json:"curve25519_public_key"`
    Nonce               []byte `json:"nonce"`
    EncryptedPayload    []byte `json:"encrypted_payload"`

type PublicKeyInfo Uses

type PublicKeyInfo struct {
    Curve25519PublicKey []byte `json:"curve25519_public_key"`

Package dhutil imports 7 packages (graph) and is imported by 3 packages. Updated 2018-07-25. Refresh now. Tools for package owners.