Skip to content
- Courses
- DSA to Development
- Newly Launched!
- For Working Professionals
- For Students
- GATE Exam Courses
- All Courses
- Tutorials
- Data Structures & Algorithms
- DSA for Beginners
- Data Structures
- Algorithms
- Complete DSA Tutorial
- Competitive Programming
- Company Wise SDE Sheets
- DSA Cheat Sheets
- Top 100 DSA Interview Questions Topic-wise
- 100 Days of Code
- Python
- ML & Data Science
- Machine Learning
- Data Science Tutorial
- Data Science Packages
- Data Visualization
- Data Analysis
- Deep Learning
- NLP Tutorial
- OpenCV Tutorial
- Interview Questions
- System Design
- Interview Corner
- Languages
- Web Development
- HTML
- CSS
- JavaScript
- TypeScript
- ReactJS
- Node.js
- PHP
- AngularJS
- jQuery
- Web Development Using Python
- Web Design
- 100 Days of Web Development
- CS Subjects
- DevOps And Linux
- School Learning
- GATE
- GeeksforGeeks Videos
- Data Structures & Algorithms
- Jobs
- Practice
- All DSA Problems
- Problem of the Day
- Company Wise Coding Practice
- GfG SDE Sheet
- Practice Problems Difficulty Wise
- Language Wise Coding Practice
- Curated DSA Lists
- Contests
-
Last Updated : 26 Aug, 2024
Summarize
Comments
Improve
The <keygen> tag in HTML is used to specify a key-pair generator field in a form. The purpose of <keygen> element is to provide a secure way to authenticate users. When a form is submitted then two keys are generated, private key and public key. The private key is stored locally, and the public key is sent to the server. The public key is used to generate a client certificate to authenticate the user for the future.
Note: <keygen> tag is not supported in html5
Syntax:
<keygen name = "name">
Example:
html <!DOCTYPE html><html><head> <title> HTML keygen tag </title></head><body> <h1 style="color:green;"> GeeksforGeeks </h1> <h2>Keygen Tag</h2> <form> Username: <input type="text" name="uname"> <br><br> Encryption: <keygen name="secure"> <input type="submit"> </form></body></html>
Output:
Supported Browsers: The browser supported by <keygen> tag are listed below:
- Google Chrome
- Firefox
- Safari
- Opera
HTML keygen Tag – FAQs
What attributes were commonly used with the <keygen> tag?
Common attributes included:
- name: The name of the control, used for form submission.
- challenge: A string used for additional verification during key generation.
- autofocus: Automatically focuses on the element when the page loads.
- disabled: Disables the element, preventing user interaction.
Can I still use the <keygen> tag in legacy systems?
While you can technically use the <keygen> tag in legacy systems, it is strongly discouraged due to its deprecation and lack of support in modern browsers. It is better to migrate to more current solutions.
What was a common use case for the <keygen> tag?
The <keygen> tag was commonly used in applications requiring client-side certificates, such as secure email clients or enterprise systems where user authentication was performed via certificate-based authentication.
Why is the <keygen> tag deprecated in HTML5?
The <keygen> tag is deprecated because it had limited support, caused security concerns, and newer, more secure methods for handling cryptographic operations, like the Web Cryptography API, have become available.
What is the modern alternative to the <keygen> tag?
The Web Cryptography API is the modern alternative, allowing developers to generate key pairs, handle digital signatures, and perform cryptographic operations in a more secure and controlled way.
Please Login to comment...
Similar Reads
HTML DOM Keygen autofocus Property
The keygen autofocus property in HTML DOM is used to set or return the value of the autofocus attribute of an <keygen> element. The autofocus attribute is used to define whether the keygen element gets automatically focused or not when the page loads or a refresh takes place. Syntax: Returns the autofocus property. keygenObject.autofocusSets
2 min read
HTML <keygen> autofocus Attribute
The HTML <keygen> autofocus Attribute is used to specify that the <keygen> element should get focused when the page loads. It is a boolean attribute. Note: It supports only the following elements: <button>, <input>, <select> and <textarea> Syntax: <keygen autofocus> Example: Below example illustrates the au
1 min read
How to specify that a keygen element should be disabled in HTML ?
The <keygen>element in HTML helps in encryption key generation so that data can be transferred between the server and client securely. This encryption may affect the user experience and reduce website performance in the case of users with fewer system requirements. This can cause issues in the user interface and may lead to confusion in the u
1 min read
HTML keygen name Attribute
The HTML <keygen> name Attribute is used to specify the name of the <keygen> Element. Syntax: <keygen name="name"> Attribute Values: It contains a single value name that describes the name of the <keygen> Element. Example: C/C++ Code <!DOCTYPE html> <html> <head> <title> HTML keygen name Attribute
1 min read
HTML <keygen> form Attribute
The HTML <keygen> form attribute is used to specify one or more forms that the <keygen> element belongs to. Syntax: <keygen form="form_id"> Attribute Values: It contains single value form_id which specifies the one or more than one form that Keygen elements belong to. The value of this attribute should be id of the <form> el
1 min read
HTML DOM Keygen disabled Property
The HTML DOM Keygen disabled property is used to set or return a boolean value that indicates whether a Keygen element should be disabled or not. A disabled keygen field is unusable. This property is used to reflect the HTML disabled attribute. Syntax: Return the disabled property. KeygenObject.disabled Set the disabled property: KeygenObject.disab
1 min read
HTML <keygen> disabled Attribute
The HTML <keygen> disabled attribute is a boolean attribute that indicates whether the <keygen> element is disabled or not. It is used to keep a user from using an input field until some conditions would be applied to it. Note: We can use JavaScript to change the value of the disabled <keygen> element. Syntax: <keygen disabled
1 min read
HTML DOM Keygen Object
The HTML DOM keygen object is used to represent the <keygen> element. The <keygen> element will be created using HTML DOM document.createElement() method and accessed by getElementById(). It is new in HTML5. Syntax: document.getElementById("ID"); Property Values autofocus: It is used to set or return the keygen element get focus or not
2 min read
HTML DOM Keygen form Property
The Keygen form property in HTML DOM is used to return the reference of the form containing the keygen element. It is a read-only property and returns the form object on success. Syntax: keygenObject.formReturn Value: It returns a reference to the form element containing the keygen element. It returns NULL if the keygen is not in the form. Example:
1 min read
HTML DOM Keygen type Property
The HTML DOM Keygen type property is used to return the type of form element containing the Keygen field. This property will always return “keygen”. Syntax: Return the keygen type property. keygenObject.typeReturn Values: It returns a string value that represents the type of form element's keygen field. Example: Below program illustrates the use of
1 min read
HTML <keygen> keytype Attribute
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. Syntax: <keygen keytype="rsa|dsa|ec">Attribute values: rsa: It is a default value. It defines an RSA security algorithm. It gives
1 min read
HTML DOM Keygen name Property
The keygen name property in HTML DOM is used to set or return the value of the name attribute of the <keygen> element. The name attribute is used to specify the name of the keygen element. Syntax: It returns the name property. keygenObject.name It sets the name property. keygenObject.name = keygenName Return Values: It returns a string value
1 min read
HTML DOM Keygen keytype Property
The HTML Keygen keytype property in HTML DOM is used to set or return the value of the keytype attribute of the keygen element. The keytype attribute is used to define the type of key that will be used. Syntax: It returns a keytype property. keygenObject.keytypeIt is used to set the keytype property. keygenObject.keytype = "rsa|dsa|ec"Property valu
2 min read
How to set a name for keygen element in HTML5 ?
In HTML, the <keygen> tag is used to specify a key-pair generator field during a form, and the <keygen> name attribute is used to set the name of the keygen element. The aim of <keygen> element is to supply a secure thanks to authenticate users. When a form is submitted then two keys are generated, the private key and the public k
2 min read
How to set a keygen element that automatically get focused when page loads in HTML5 ?
The <keygen> tag in HTML is used to specify a key-pair generator field in a form. The purpose of this element is to provide a secure way to authenticate users. When a form is submitted then two keys are generated, private key and public key. The private key is stored locally, and the public key is sent to the server. The public key is used to
1 min read
How to specify one or more forms the keygen element belongs to ?
The task is to specify one or more forms the keygen element belongs to. You can easily do this by using the form attribute which is an attribute of keygen element. form element is used to create an HTML form for user input. keygen element is used to specify a key-pair generator field in a form and used to provide a secure way to authenticate users.
2 min read
Which tag is used to represent progress of a task in HTML & how is it different from <meter> tag ?
In this article, we will see which tag is used to represent the progress of a task in HTML. To represent the progress of a task, we will use the <progress> tag. This tag is used to represent the progress of a task. It is also defined how much work is done and how much is left. Syntax: <progress attributes...> </progress> Attribute
2 min read
Is container tag same as the empty tag in HTML? If not, why ?
In this article, we will see the container tag & empty tag in HTML, along with knowing how they're different from each other. The Container tag is not the same as the empty tag & these are two different categories of tags used in HTML. Container tag: This tag contains 3 parts, namely, the opening tag, content that will be displayed in the b
5 min read
Why <big> tag is not in HTML5 while <small> tag exists ?
The <big> tag was discontinued in HTML5 while <small> tag is still in handy because <small> tag is frequently used to represent small prints like footnotes, copyright notices, comments etc. Many alternatives for <big> tag are already available such as <h1>, <h2> and so on. In HTML5 instead of using <big>, y
2 min read
Explain the difference between head Tag and header Tag in HTML5 ?
The <head> element is a container for metadata and is placed between the <html> and <body> tags. The <header> is for the main content section's introductory elements, like headings or logos and it mainly focuses on what appears at the top of the webpage. <head> ElementThe <head> element is part of the HTML docume
1 min read
What is the difference between the <br> Tag and the <p> Tag ?
The <br> tag is used to insert a line break, creating a new line within text or content. It doesn't have a closing tag and is a self-closing tag. On the other hand, the <p> tag defines a paragraph, separating blocks of text. It has an opening <p> and a closing </p> tag, allowing for the structured organization of text into p
2 min read
Difference between <article> tag and <section> tag
Both the tags are semantics in HTML 5. In this article, we will discuss about the <article> and <section> tag. Both the <article> and <section> tags are represented similarly but used for some meaning, that meaning is for the browsers and the developers. Both tags can replace each other as there will be no changes to the out
4 min read
What purpose does a <script> tag serve inside of a <noscript> tag?
Usage of NoScript tag: The tag defines alternate content that will be displayed if the user has disabled script or browser does not support script. It can be used inside both <head> and <body> tag. Syntax: <noscript> Contents... </noscript> Example: [GFGTABS] HTML <html> <head> <title>wbr Tag</title>
1 min read
HTML <html> Tag
HTML is a language full of diverse elements, and one such element is the <html> tag. This tag, standing for ‘HyperText Markup Language’, is used to define the root of an HTML or XHTML document. It serves as the main container for all other HTML elements, excluding the <!DOCTYPE> declaration. Understanding the <html> TagThe <htm
3 min read
HTML | <noframes> Tag
The <noframes> tag is the backup for those browsers that does not support frames. This tag can contains all the element that can be placed in <body> tag. It is used to create link with the non-frame set version of any website where you want to display a message to the user. This <noframes> tag is not supported in HTML5. Syntax:
1 min read
HTML <hgroup> Tag
The <hgroup> tag in HTML stands for heading group and is used to group the heading elements. The <hgroup> tag in HTML is used to wrap one or more heading elements from <h1> to <h6>, such as the headings and sub-headings. The <hgroup> tag requires the starting tag as well as ending tag. Note: <hgroup> is deprecate
1 min read
HTML | <bgsound> tag
The HTML <bgsound> tag is used to play the soundtrack in the background, when you leave the page behind and open a new tab this tag will continuously play the track in the background. This tag is not for other browsers except the Internet Explorer. It does not display any graphical interface just played the track in the background. Syntax:
1 min read
HTML | <isindex> tag
The <isindex> tag is used to querying any document through a text field. Means this tag inform the browser that the user wants to provide the search function through the document. If you want to search any specific word in a long article this tag is helpful then. But during these days all the browsers contain that feature by pressing CTRL + F
2 min read
How to use Meta Tag to redirect an HTML page?
URL redirection, also called URL forwarding is a way to send users to a different URL from the one they originally requested. The three most commonly used redirects are 301, 302, and Meta Refresh. Meta Refresh Redirect is a client-side redirect. Unlike 301 and 302 redirects that happen on the webserver, Meta Refresh Redirect takes place in a web br
1 min read
Differences between HTML <center> Tag and CSS "text-align: center;" Property
If you are designing a simple web page, then not much difference is noticeable, but it is very necessary to understand the basic differences between these two. Since we are only concerned with the text, these elements do not have separate meanings.HTML <center> tag: The <center> tag in HTML is used to set to align of text into the cente
3 min read
Article Tags :
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, check: true }), success:function(result) { jQuery.ajax({ url: writeApiUrl + 'suggestions/auth/' + `${post_id}/`, type: "GET", dataType: 'json', xhrFields: { withCredentials: true }, success: function (result) { $('.spinner-loading-overlay:eq(0)').remove(); var commentArray = result; if(commentArray === null || commentArray.length === 0) { // when no reason is availaible then user will redirected directly make the improvment. // call to api create-improvement-post $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); return; } var improvement_reason_html = ""; for(var comment of commentArray) { // loop creating improvement reason list markup var comment_id = comment['id']; var comment_text = comment['suggestion']; improvement_reason_html += `
${comment_text}
`; } $('.improvement-reasons_wrapper').html(improvement_reason_html); $('.improvement-bottom-btn').html("Create Improvement"); $('.improve-modal--improvement').hide(); $('.improvement-reason-modal').show(); }, error: function(e){ $('.spinner-loading-overlay:eq(0)').remove(); // stop loader when ajax failed; }, }); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ $('.improvement-reason-modal').hide(); } $('.improve-modal--improvement').show(); }); function loadScript(src, callback) { var script = document.createElement('script'); script.src = src; script.onload = callback; document.head.appendChild(script); } function suggestionCall() { var suggest_val = $.trim($("#suggestion-section-textarea").val()); var array_String= suggest_val.split(" ") var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(suggest_val.length <= 2000){ var payload = { "gfg_post_id" : `${post_id}`, "suggestion" : `
${suggest_val}
`, } if(!loginData || !loginData.isLoggedIn) // User is not logged in payload["g-recaptcha-token"] = gCaptchaToken jQuery.ajax({ type:'post', url: "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/", xhrFields: { withCredentials: true }, crossDomain: true, contentType:'application/json', data: JSON.stringify(payload), success:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-section-textarea').val(""); jQuery('.suggest-bottom-btn').css("display","none"); // Update the modal content const modalSection = document.querySelector('.suggestion-modal-section'); modalSection.innerHTML = `
Thank You!
Your suggestions are valuable to us.
You can now also contribute to the GeeksforGeeks community by creating improvement and help your fellow geeks.
`; }, error:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Something went wrong."); jQuery('#suggestion-modal-alert').show(); error_msg = true; } }); } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Minimum 5 Words and Maximum Character limit is 2000."); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Enter atleast four words !"); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } if(error_msg){ setTimeout(() => { jQuery('#suggestion-section-textarea').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // load the captcha script and set the token loadScript('https://www.google.com/recaptcha/api.js?render=6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY',[], function() { setGoogleRecaptcha(); }); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.improvement-reason-modal').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); });