Home » HTML » HTML Keygen Tag

HTML Keygen

HTML Keygen Tag

The <keygen> tag specifies a key-pair generator field used for forms. When the form is submitted, the private key is stored locally, and the public key is sent to the server.

<!DOCTYPE html>
<html lang="en">
<title> HTML Keygen Tag </title>
<meta charset="UTF-8">
<form action="action-page.php" method="get">
Username: <input type="text" name="usr_name">
Encryption: <keygen name="security">
<input type="submit">


HTML Keygen Tag
Username: Encryption:

Note: This tag is not used often and is about to get removed from HTML 5.

HTML Keygen Attributes

Attributes Description
autofocus Specifies that a <keygen> element should automatically get focus when the page loads.
challenge Specifies that the value of the <keygen> element should be challenged when submitted.
form Specifies one or more forms the <keygen> element belongs to.
disabled Specifies that a <keygen> element should be disabled.
keytype Specifies the security algorithm of the key.
name Defines a name for the <keygen> element.

Browser Support

Microsoft Edge browser.png Edge
Chrome browser.png Chrome
Firefox browser.png Firefox
Opera browser.png Opera
safari browser.png Safari

Color Picker

List of color names supported by all browser »

Character Code

List of character codes to display special character »

Language Code

List of all language supported by all browser »

Country Code

List of Country code supported by all browser »

Latest Updates

PHP Introduction

How to Run a PHP program in Xampp?

How can I create a phpinfo.php page?

How to Define a Variable in PHP

PHP Echo and Print Statements

Working with PHP Operators

Understanding the PHP Data Types

How to Write Comments in PHP

How to Define a Constant in PHP

PHP if...else...elseif Statements