Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML <keygen> keytype Attribute

  • Last Updated : 05 Oct, 2021

The HTML <keygen> keytype attribute is used to define the type of key which would be used. Basically, this attribute is used to secure the form data. 

Note: The keytype may be different in different browsers.


<keygen keytype="rsa|dsa|ec">

Attribute values:

  • rsa: It is a default value. It defines an RSA security algorithm. It gives a  choice of RSA key strengths to the user.
  • dsa: It defines a DSA security algorithm. It gives a choice of DSA key sizes to the user.
  • ec: It defines an EC security algorithm. It gives a choice of EC key strengths to the user.


Example: Below code illustrates the keytype attribute of the <keygen> element.


<!DOCTYPE html>
        HTML keygen keytype attribute
        <h1 style="color:green;">
        <h2>HTML Keygen keytype attribute</h2>
            Username: <input type="text" name="uname">
            Encryption: <keygen form="myGeeks" 
                keytype="rsa" name="secure" disabled>
            <input type="submit">


Supported Browsers:

  • Google Chrome
  • Firefox
  • Opera

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!