Better PHP Documentation
opinionated
Open main menu
Get Started
Documentation
Community
Training
Better PHP Documentation
Close menu
Get Started
Documentation
Community
Training
Log in
Change language:
English
German
Spanish
French
Italian
Japanese
Brazilian Portuguese
Russian
Turkish
Ukrainian
Chinese (Simplified)
Other
Sodium
Introduction
Installing/Configuring
Requirements
Installation
Predefined Constants
Sodium Functions
sodium_add
β Add large numbers
sodium_base642bin
β Decodes a base64-encoded string into raw binary.
sodium_bin2base64
β Encodes a raw binary string with base64.
sodium_bin2hex
β Encode to hexadecimal
sodium_compare
β Compare large numbers
sodium_crypto_aead_aegis128l_decrypt
β Verify then decrypt a message with AEGIS-128L
sodium_crypto_aead_aegis128l_encrypt
β Encrypt then authenticate a message with AEGIS-128L
sodium_crypto_aead_aegis128l_keygen
β Generate a random AEGIS-128L key
sodium_crypto_aead_aegis256_decrypt
β Verify then decrypt a message with AEGIS-256
sodium_crypto_aead_aegis256_encrypt
β Encrypt then authenticate a message with AEGIS-256
sodium_crypto_aead_aegis256_keygen
β Generate a random AEGIS-256 key
sodium_crypto_aead_aes256gcm_decrypt
β Verify then decrypt a message with AES-256-GCM
sodium_crypto_aead_aes256gcm_encrypt
β Encrypt then authenticate with AES-256-GCM
sodium_crypto_aead_aes256gcm_is_available
β Check if hardware supports AES256-GCM
sodium_crypto_aead_aes256gcm_keygen
β Generate a random AES-256-GCM key
sodium_crypto_aead_chacha20poly1305_decrypt
β Verify then decrypt with ChaCha20-Poly1305
sodium_crypto_aead_chacha20poly1305_encrypt
β Encrypt then authenticate with ChaCha20-Poly1305
sodium_crypto_aead_chacha20poly1305_ietf_decrypt
β Verify that the ciphertext includes a valid tag
sodium_crypto_aead_chacha20poly1305_ietf_encrypt
β Encrypt a message
sodium_crypto_aead_chacha20poly1305_ietf_keygen
β Generate a random ChaCha20-Poly1305 (IETF) key.
sodium_crypto_aead_chacha20poly1305_keygen
β Generate a random ChaCha20-Poly1305 key.
sodium_crypto_aead_xchacha20poly1305_ietf_decrypt
β (Preferred) Verify then decrypt with XChaCha20-Poly1305
sodium_crypto_aead_xchacha20poly1305_ietf_encrypt
β (Preferred) Encrypt then authenticate with XChaCha20-Poly1305
sodium_crypto_aead_xchacha20poly1305_ietf_keygen
β Generate a random XChaCha20-Poly1305 key.
sodium_crypto_auth
β Compute a tag for the message
sodium_crypto_auth_keygen
β Generate a random key for sodium_crypto_auth
sodium_crypto_auth_verify
β Verifies that the tag is valid for the message
sodium_crypto_box
β Authenticated public-key encryption
sodium_crypto_box_keypair
β Randomly generate a secret key and a corresponding public key
sodium_crypto_box_keypair_from_secretkey_and_publickey
β Create a unified keypair string from a secret key and public key
sodium_crypto_box_open
β Authenticated public-key decryption
sodium_crypto_box_publickey
β Extract the public key from a crypto_box keypair
sodium_crypto_box_publickey_from_secretkey
β Calculate the public key from a secret key
sodium_crypto_box_seal
β Anonymous public-key encryption
sodium_crypto_box_seal_open
β Anonymous public-key decryption
sodium_crypto_box_secretkey
β Extracts the secret key from a crypto_box keypair
sodium_crypto_box_seed_keypair
β Deterministically derive the key pair from a single key
sodium_crypto_core_ristretto255_add
β Adds an element
sodium_crypto_core_ristretto255_from_hash
β Maps a vector
sodium_crypto_core_ristretto255_is_valid_point
β Determines if a point on the ristretto255 curve
sodium_crypto_core_ristretto255_random
β Generates a random key
sodium_crypto_core_ristretto255_scalar_add
β Adds a scalar value
sodium_crypto_core_ristretto255_scalar_complement
β The sodium_crypto_core_ristretto255_scalar_complement purpose
sodium_crypto_core_ristretto255_scalar_invert
β Inverts a scalar value
sodium_crypto_core_ristretto255_scalar_mul
β Multiplies a scalar value
sodium_crypto_core_ristretto255_scalar_negate
β Negates a scalar value
sodium_crypto_core_ristretto255_scalar_random
β Generates a random key
sodium_crypto_core_ristretto255_scalar_reduce
β Reduces a scalar value
sodium_crypto_core_ristretto255_scalar_sub
β Subtracts a scalar value
sodium_crypto_core_ristretto255_sub
β Subtracts an element
sodium_crypto_generichash
β Get a hash of the message
sodium_crypto_generichash_final
β Complete the hash
sodium_crypto_generichash_init
β Initialize a hash for streaming
sodium_crypto_generichash_keygen
β Generate a random generichash key
sodium_crypto_generichash_update
β Add message to a hash
sodium_crypto_kdf_derive_from_key
β Derive a subkey
sodium_crypto_kdf_keygen
β Generate a random root key for the KDF interface
sodium_crypto_kx_client_session_keys
β Calculate the client-side session keys.
sodium_crypto_kx_keypair
β Creates a new sodium keypair
sodium_crypto_kx_publickey
β Extract the public key from a crypto_kx keypair
sodium_crypto_kx_secretkey
β Extract the secret key from a crypto_kx keypair.
sodium_crypto_kx_seed_keypair
β Description
sodium_crypto_kx_server_session_keys
β Calculate the server-side session keys.
sodium_crypto_pwhash
β Derive a key from a password, using Argon2
sodium_crypto_pwhash_scryptsalsa208sha256
β Derives a key from a password, using scrypt
sodium_crypto_pwhash_scryptsalsa208sha256_str
β Get an ASCII encoded hash
sodium_crypto_pwhash_scryptsalsa208sha256_str_verify
β Verify that the password is a valid password verification string
sodium_crypto_pwhash_str
β Get an ASCII-encoded hash
sodium_crypto_pwhash_str_needs_rehash
β Determine whether or not to rehash a password
sodium_crypto_pwhash_str_verify
β Verifies that a password matches a hash
sodium_crypto_scalarmult
β Compute a shared secret given a user's secret key and another user's public key
sodium_crypto_scalarmult_base
β Alias of sodium_crypto_box_publickey_from_secretkey
sodium_crypto_scalarmult_ristretto255
β Computes a shared secret
sodium_crypto_scalarmult_ristretto255_base
β Calculates the public key from a secret key
sodium_crypto_secretbox
β Authenticated shared-key encryption
sodium_crypto_secretbox_keygen
β Generate random key for sodium_crypto_secretbox
sodium_crypto_secretbox_open
β Authenticated shared-key decryption
sodium_crypto_secretstream_xchacha20poly1305_init_pull
β Initialize a secretstream context for decryption
sodium_crypto_secretstream_xchacha20poly1305_init_push
β Initialize a secretstream context for encryption
sodium_crypto_secretstream_xchacha20poly1305_keygen
β Generate a random secretstream key.
sodium_crypto_secretstream_xchacha20poly1305_pull
β Decrypt a chunk of data from an encrypted stream
sodium_crypto_secretstream_xchacha20poly1305_push
β Encrypt a chunk of data so that it can safely be decrypted in a streaming API
sodium_crypto_secretstream_xchacha20poly1305_rekey
β Explicitly rotate the key in the secretstream state
sodium_crypto_shorthash
β Compute a short hash of a message and key
sodium_crypto_shorthash_keygen
β Get random bytes for key
sodium_crypto_sign
β Sign a message
sodium_crypto_sign_detached
β Sign the message
sodium_crypto_sign_ed25519_pk_to_curve25519
β Convert an Ed25519 public key to a Curve25519 public key
sodium_crypto_sign_ed25519_sk_to_curve25519
β Convert an Ed25519 secret key to a Curve25519 secret key
sodium_crypto_sign_keypair
β Randomly generate a secret key and a corresponding public key
sodium_crypto_sign_keypair_from_secretkey_and_publickey
β Join a secret key and public key together
sodium_crypto_sign_open
β Check that the signed message has a valid signature
sodium_crypto_sign_publickey
β Extract the Ed25519 public key from a keypair
sodium_crypto_sign_publickey_from_secretkey
β Extract the Ed25519 public key from the secret key
sodium_crypto_sign_secretkey
β Extract the Ed25519 secret key from a keypair
sodium_crypto_sign_seed_keypair
β Deterministically derive the key pair from a single key
sodium_crypto_sign_verify_detached
β Verify signature for the message
sodium_crypto_stream
β Generate a deterministic sequence of bytes from a seed
sodium_crypto_stream_keygen
β Generate a random sodium_crypto_stream key.
sodium_crypto_stream_xchacha20
β Expands the key and nonce into a keystream of pseudorandom bytes
sodium_crypto_stream_xchacha20_keygen
β Returns a secure random key
sodium_crypto_stream_xchacha20_xor
β Encrypts a message using a nonce and a secret key (no authentication)
sodium_crypto_stream_xchacha20_xor_ic
β Encrypts a message using a nonce and a secret key (no authentication)
sodium_crypto_stream_xor
β Encrypt a message without authentication
sodium_hex2bin
β Decodes a hexadecimally encoded binary string
sodium_increment
β Increment large number
sodium_memcmp
β Test for equality in constant-time
sodium_memzero
β Overwrite a string with NUL characters
sodium_pad
β Add padding data
sodium_unpad
β Remove padding data
SodiumException
β The SodiumException class
Found A Problem?
Learn How To Improve This Page
β’
Submit a Pull Request
β’
Report a Bug
οΌ
add a note
User Contributed Notes
1 note
up
down
12
Chris
ΒΆ
7 years ago
Libsodium documentation:
https://github.com/paragonie/pecl-libsodium-doc
οΌ
add a note
0
pcntl_sigtimedwait
Waits for signals, with a timeout
0
similar_text
Calculate the similarity between two strings
0
boolval
Get the boolean value of a variable
0
curl_multi_close
Close a set of cURL handles
0
imap_body
Read the message body
0
mb_strpos
Find position of first occurrence of string in a string
0
pg_send_prepare
Sends a request to create a prepared statement with the given parameters, without waiting for completion
0
swoole_native_socket_bind
0
Arr::prependKeysWith
0
zend_version
Gets the version of the current Zend engine
^