sodium库(加密)
Addlargenumbers
Encodetohexadecimal
Comparelargenumbers
Decryptincombinedmodewithprecalculation
Encryptincombinedmodewithprecalculation
Verifiesthatthetagisvalidforthemessage
Computeatagforthemessage
Randomlygenerateasecretkeyandacorrespondingpublickey
Verifyanddecryptaciphertext
Deterministicallyderivethekeypairfromasinglekey
Verifythatthepasswordisavalidpasswordverificationstring
Verifiesthatapasswordmatchesahash
Deriveakeyfromapassword
别名sodium_crypto_box_publickey_from_secretkey()
Computeasharedsecretgivenauser'ssecretkeyandanotheruser'spublickey
Computeafixed-sizefingerprintforthemessage
ConvertanEd25519publickeytoaCurve25519publickey
ConvertanEd25519secretkeytoaCurve25519secretkey
Randomlygenerateasecretkeyandacorrespondingpublickey
Checkthatthesignedmessagehasavalidsignature
Deterministicallyderivethekeypairfromasinglekey
Generateadeterministicsequenceofbytesfromaseed
Decodesahexadecimallyencodedbinarystring
Incrementlargenumber
Testforequalityinconstant-time
Overwritebufwithzeros
Addpaddingdata
Removepaddingdata
mcrypt 在 PHP 7.2 中已经移除,用sodium库替代
安装
从PHP 7.2.0开始,这个扩展与PHP捆绑在一起。对于较旧的PHP版本,此扩展可通过PECL获得。
为了使用这个扩展,您必须使用--with-nadier[=DIR]配置选项编译PHP。
window上,要使用此扩展,必须将extension=php_nadium.dll添加到php.ini。