sodium-native

sodium-native

  • Get Started
  • API
  • Github

›API

Get Started

  • Introduction
  • Projects using sodium-native

API

  • Compatibility
  • API
  • Memory Protection
  • Generating Random Data
  • Helpers
  • Padding
  • Signing
  • Generic Hashing
  • Public/Secret Key Box Encryption
  • Sealed Box Encryption
  • Secret Key Box Encryption
  • AEAD (Authenticated Encryption with Additional Data)
  • Non-Authenticated Streaming Encryption
  • Authentication
  • Stream Encryption
  • One-Time Authentication
  • Password Hashing
  • Key Exchange
  • Diffie-Hellman
  • Finite Field Arithmetic
  • Short Hashes
  • Key Derivation
  • SHA
  • License

Authentication

Bindings for the crypto_auth API. See the libsodium crypto_auth docs for more information.

Constants

Buffer lengths (integer)

  • crypto_auth_BYTES
  • crypto_auth_KEYBYTES

String constants (string)

  • crypto_auth_PRIMITIVE

crypto_auth

sodium-native

sodium.crypto_auth(out, in, k)

Creates an authentication token.

  • out should be a buffer of length crypto_auth_BYTES
  • in should be a buffer of any size
  • k should be a buffer of length crypto_auth_KEYBYTES

The generated token is stored in out.


crypto_auth_verify

sodium-native

var bool = sodium.crypto_auth_verify(out, in, k)

Verifies a token.

  • out should be a buffer of length crypto_auth_BYTES
  • in should be a buffer of any size
  • k should be a buffer of length crypto_auth_KEYBYTES

Returns true if the token could be verified. Otherwise false.

← Non-Authenticated Streaming EncryptionStream Encryption →
  • Constants
  • crypto_auth
  • crypto_auth_verify
Docs
Get StartedAPI
Community
LibsodiumHyperdivisionHyperdivision on Twitter
More
GitHubStar
Copyright © 2020 Hyperdivision