Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

How to set the security algorithm of key in HTML5 ?

  • Last Updated : 01 Apr, 2021

In this article, we will see how to set the security algorithm of key using HTML5. To set the security algorithm of key <keygen> tag is used. This tag specifies a key-pair generator field used for forms. The private key is saved locally and the public key is sent to the server when the form is sent. The element’s aim is to provide a safe method of user authentication. When a form is submitted, two keys, a private key and a public key, are produced. The public key is sent to the server, while the private key is kept locally. The public key is used to build a client certificate that can be used to validate the user’s identity in the future.

Syntax:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<keygen name = "name">

Example:

HTML






<!DOCTYPE html>
<html>
  
<body>
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
  
    <h2
        Specifying the security algorithm 
        of the key in HTML5
    </h2>
  
    <form>
        Username: <input type="text" name="name">
        <br><br> Encryption: <keygen name="key">
        <input type="submit">
    </form>
</body>
  
</html>

Output:

 

Supported Browsers:

  • Google Chrome
  • Firefox
  • Opera
  • Apple Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :