Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The Nuxed Crypto component provides a high-level cryptography interface that relies on libsodium for all of its underlying cryptography operations.

License

NotificationsYou must be signed in to change notification settings

nuxed/crypto

Repository files navigation

Coding standards statusStatic analysis statusUnit tests statusTotal DownloadsLatest Stable VersionLicense

Nuxed Crypto

The Nuxed Crypto component provides a high-level cryptography interface that relies on libsodium for all of its underlying cryptography operations.

inspired byHalite.

Important

Although this library has developed with care, it has not been examined by security experts, there will always be a chance that we overlooked something. Please ask your favourite trusted hackers to hammer it for implementation errors and bugs before even thinking about deploying it in production.

Installation

This package can be installed withComposer.

$composer require nuxed/crypto

Example

usenamespace Nuxed\{Crypto,Filesystem};usenamespace Nuxed\Crypto\Symmetric;<<__EntryPoint>>asyncfunctionmain():Awaitable<void> {// generate a key :$key=Symmetric\Encryption\Key::generate();// or load a stored encryption key :$file=newFilesystem\File('/path/to/encryption.key');$key=$key=Symmetric\Encryption\Key::import(newCrypto\HiddenString(await$file->read())  );$message=newCrypto\HiddenString('Hello, World!');$ciphertext=Symmetric\Encryption\encrypt($message,$key);$plaintext=Symmetric\Encryption\decrypt($ciphertext,$key);print$plaintext->toString();// Hello, World!}

Security

For information on reporting security vulnerabilities in Nuxed, seeSECURITY.md.


License

Nuxed is open-sourced software licensed under the MIT-licensed.


[8]ページ先頭

©2009-2025 Movatter.jp