sodium_crypto_box

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_boxAuthenticated public-key encryption

Beschreibung

sodium_crypto_box(string $message, string $nonce, string $key_pair): string

Encrypt a message using asymmetric (public key) cryptography.

The algorithm used by functions prefixed with sodium_crypto_box() are Elliptic Curve Diffie-Hellman over the Montgomery curve, Curve25519; usually abbreviated as X25519.

Parameter-Liste

message

The message to be encrypted.

nonce

A number that must be only used once, per message. 24 bytes long. This is a large enough bound to generate randomly (i.e. random_bytes()).

key_pair

See sodium_crypto_box_keypair_from_secretkey_and_publickey(). This should include the sender's X25519 secret key and the recipient's X25519 public key.

Rückgabewerte

Returns the encrypted message (ciphertext plus authentication tag). The ciphertext will be 16 bytes longer than the plaintext, and a raw binary string. See sodium_bin2base64() for safe encoding for storage.

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

"Why adore HTMX over JavaScript?"

What specific features or aspects of HTMX, a library designed to enhance interactions in web applications, appeal to users who have a strong affin ...

Geschrieben von WartanThamar am 02.05.2024 06:53:08
Forum: HTML, JavaScript, AJAX, jQuery, CSS, Bootstrap, LESS
What defines Laravel's developer community?

What factors contribute to the perceived happiness within the Laravel developer community, and how does this compare to other developer communitie ...

Geschrieben von BakhamMamodar am 01.05.2024 10:45:23
Forum: PHP Developer Forum
"How to warm cold entrance?"

What are some effective strategies for addressing the significant heat loss occurring in the entrance hall, which is noticeably the coldest area o ...

Geschrieben von NeerMohan am 01.05.2024 06:49:27
Forum: Fragen/Vorschläge zum Forum