mhash_keygen_s2k

(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)

mhash_keygen_s2kGenerates a key

Warnung

Diese Funktion ist seit PHP 8.1.0 DEPRECATED (veraltet). Von der Verwendung dieser Funktion wird dringend abgeraten.

Beschreibung

mhash_keygen_s2k(
    int $algo,
    string $password,
    string $salt,
    int $length
): string|false

Generates a key according to the given algo, using an user provided password.

This is the Salted S2K algorithm as specified in the OpenPGP document (» RFC 2440).

Keep in mind that user supplied passwords are not really suitable to be used as keys in cryptographic algorithms, since users normally choose keys they can write on keyboard. These passwords use only 6 to 7 bits per character (or less). It is highly recommended to use some kind of transformation (like this function) to the user supplied key.

Parameter-Liste

algo

The hash ID used to create the key. One of the MHASH_hashname constants.

password

An user supplied password.

salt

Must be different and random enough for every key you generate in order to create different keys. Because salt must be known when you check the keys, it is a good idea to append the key to it. Salt has a fixed length of 8 bytes and will be padded with zeros if you supply less bytes.

length

The key length, in bytes.

Rückgabewerte

Returns the generated key as a string, or false on error.

Changelog

Version Beschreibung
8.1.0 This function has been deprecated. Use the hash_*() functions instead.

Hier Kannst Du einen Kommentar verfassen


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

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

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

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

Gelöschte Datensätze in Datenbank ausgeben

Da hilft die Doku: https://www.php.net/manual/de/mysqli.affected-rows.php speed stars (https://speed-stars.github.io) Thank you so much!

Geschrieben von daberer am 30.05.2025 10:59:06
Forum: SQL / Datenbanken
Suche nach Best Practices zur Leistungsoptimierung von PHP-Skripten!!

Hallo zusammen, Ich habe an einem Projekt mit einigen komplexen PHP-Skripten gearbeitet und mir sind Leistungsprobleme aufgefallen, insbesondere ...

Geschrieben von Isabellay am 30.05.2025 09:41:02
Forum: PHP Developer Forum
Variable Gültigkeit in Blöcken

That's a sharp observation! You're absolutely right – the core issue isn't where the console.log() is placed, but when it executes relative to w ...

Geschrieben von Bendomenech68 am 30.05.2025 09:28:17
Forum: HTML, JavaScript, AJAX, jQuery, CSS, Bootstrap, LESS
Eingabe in einer Datenbank

Schön, dass du dich mit SQL und PHP beschäftigst. Wenn die Ausgabe aus der Datenbank schon funktioniert, aber die Eingabe nicht, kann es tatsäc ...

Geschrieben von karina am 30.05.2025 09:14:22
Forum: SQL / Datenbanken