The HTML keygen element is used in submitting the forms with security. This submits a public key and generates a private key.
It is used in the form to generate key pair.
When we submit the form, it creates two key pair, one is for Public Key and other is for Private Key. The public key is sent with the data submitted to the form. The private key is in the encrypted form of data and it is stored in the database of local key.
The KEYGEN element is mostly used in the cases where user wants to generate some unique key to submit a form.
Syntax:
<keygen name="key">
Example:
<!DOCTYPE html>
<html>
<head>
<title>Title name</title>
</head>
<body>
<form action="keygen.php" method="post">
Username: <input type="text" name="text">
Encryption: <keygen name="key">
<input type="submit">
</form>
</body>
</html>
0 Comment(s)