Crypt-NaCl-Sodium
view release on metacpan or search on metacpan
memzero
memzero($a, $b, ...);
Replaces the value of the provided stringified variables with "null"
bytes. Length of the zeroed variables is unchanged.
random_number
my $num = random_number($upper_bound);
Returns an unpredictable number between 0 and optional $upper_bound
(excluded). If $upper_bound is not specified the maximum value is
0xffffffff (included).
increment
increment($nonce, ...);
NOTE: This function is deprecated and will be removed in next version.
Please use "increment" in Data::BytesLocker.
Increments an arbitrary long unsigned number(s) (in place). Function
runs in constant-time for a given length of arguments and considers them
to be encoded in little-endian format.
random_bytes
my $bytes = random_bytes($num_of_bytes);
Generates unpredictable sequence of $num_of_bytes bytes.
The length of the $bytes equals the value of $num_of_bytes.
Returns Data::BytesLocker object.
add
# equivalent of sodium_add($S, $l, length($l))
my $x = Crypt::NaCl::Sodium::add($S, $l);
Accepts two integers. It computes (a + b) mod 2^(8*len) in constant time
for a given length and returns the result.
Returns Integer
has_aes128ctr
my $supported = Crypt::NaCl::Sodium::has_aes128ctr()
Checks whether the underlying libsodium supports ASE128CTR
Returns &PL_sv_yes or &PL_sx_no
sodium_version_string
my $version = Crypt::NaCl::Sodium::sodium_version_string()
Gets the libsodium version string
Returns a string like "1.0.18"
VARIABLES
$Data::BytesLocker::DEFAULT_LOCKED
use Crypt::NaCl::Sodium;
$Data::BytesLocker::DEFAULT_LOCKED = 1;
By default all values returned from the provided methods are unlocked
Data::BytesLocker objects. If this variable is set to true then the
returned objects are locked and require calling "unlock" in
Data::BytesLocker before accessing.
SEE ALSO
* Crypt::NaCl::Sodium::secretbox - Secret-key authenticated encryption
(XSalsa20/Poly1305 MAC)
* Crypt::NaCl::Sodium::auth - Secret-key message authentication
(HMAC-SHA256, HMAC-SHA512, HMAC-SHA512/256 )
* Crypt::NaCl::Sodium::aead - Authenticated Encryption with Additional
Data (ChaCha20/Poly1305 MAC, AES256-GCM)
* Crypt::NaCl::Sodium::box - Public-key authenticated encryption
(Curve25519/XSalsa20/Poly1305 MAC)
* Crypt::NaCl::Sodium::sign - Public-key signatures (Ed25519)
* Crypt::NaCl::Sodium::generichash - Generic hashing (Blake2b)
* Crypt::NaCl::Sodium::shorthash - Short-input hashing (SipHash-2-4)
* Crypt::NaCl::Sodium::pwhash - Password hashing (yescrypt)
* Crypt::NaCl::Sodium::hash - SHA-2 (SHA-256, SHA-512)
* Crypt::NaCl::Sodium::onetimeauth - One-time authentication
(Poly1305)
* Crypt::NaCl::Sodium::scalarmult - Diffie-Hellman (Curve25519)
* Crypt::NaCl::Sodium::stream - Stream ciphers (XSalsa20, ChaCha20,
Salsa20, AES-128-CTR)
* Data::BytesLocker - guarded data storage
* libsodium <http://jedisct1.gitbooks.io/libsodium> - libsodium
AUTHOR
Alex J. G. BurzyÃ
Âski <ajgb@cpan.org>
COPYRIGHT & LICENSE
Copyright (c) 2015 Alex J. G. BurzyÃ
Âski. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
( run in 2.216 seconds using v1.01-cache-2.11-cpan-fe3c2283af0 )