{"id":3586,"date":"2026-11-27T10:07:59","date_gmt":"2026-11-27T04:37:59","guid":{"rendered":"https:\/\/larapush.com\/blog\/?p=3586"},"modified":"2026-11-27T10:07:59","modified_gmt":"2026-11-27T04:37:59","slug":"web-push-encryption-explained","status":"publish","type":"post","link":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/","title":{"rendered":"How Are Web Push Notifications Encrypted?"},"content":{"rendered":"\n<p><strong>Web push encryption uses the Message Encryption for Web Push standard, RFC 8291. Your server combines its own temporary key with the browser&#8217;s p256dh public key and 16-byte auth secret through ECDH, then encrypts the payload with AES-128-GCM. The push service only relays ciphertext. Only the subscribed browser can decrypt the notification.<\/strong><\/p>\n\n\n\n<p>When people ask me whether web push is private, the honest answer has two parts. The message content is end-to-end encrypted between your server and the visitor&#8217;s browser. However, the push service still sees metadata, such as when you sent a message and to which endpoint. Here&#8217;s how web push encryption works, step by step, and what it does and doesn&#8217;t protect.<\/p>\n\n\n\n<p>Key facts at a glance:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Standard:<\/strong> <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc8291\" target=\"_blank\" rel=\"noreferrer noopener\">RFC 8291<\/a> defines web push encryption, and <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc8188\" target=\"_blank\" rel=\"noreferrer noopener\">RFC 8188<\/a> defines the aes128gcm content coding it uses.<\/li>\n\n\n\n<li><strong>Keys:<\/strong> each subscription carries a P-256 public key (p256dh) and a 16-byte auth secret, created by the browser.<\/li>\n\n\n\n<li><strong>Cipher:<\/strong> AES-128-GCM, with keys derived through ECDH and HKDF.<\/li>\n\n\n\n<li><strong>Size:<\/strong> push services only have to accept 4,096 bytes of encrypted body, which leaves at most 3,993 bytes of plaintext.<\/li>\n\n\n\n<li><strong>VAPID is separate:<\/strong> VAPID (<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc8292\" target=\"_blank\" rel=\"noreferrer noopener\">RFC 8292<\/a>) proves who sent the message. It doesn&#8217;t encrypt anything.<\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_63 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#How_does_web_push_encryption_work\" title=\"How does web push encryption work?\">How does web push encryption work?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#What_are_the_p256dh_and_auth_keys_in_a_push_subscription\" title=\"What are the p256dh and auth keys in a push subscription?\">What are the p256dh and auth keys in a push subscription?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#Can_the_push_service_read_your_notifications\" title=\"Can the push service read your notifications?\">Can the push service read your notifications?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#Is_VAPID_the_same_as_web_push_encryption\" title=\"Is VAPID the same as web push encryption?\">Is VAPID the same as web push encryption?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#What_is_the_difference_between_aes128gcm_and_aesgcm\" title=\"What is the difference between aes128gcm and aesgcm?\">What is the difference between aes128gcm and aesgcm?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#Do_you_have_to_write_the_encryption_code_yourself\" title=\"Do you have to write the encryption code yourself?\">Do you have to write the encryption code yourself?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#Does_encryption_limit_the_payload_size\" title=\"Does encryption limit the payload size?\">Does encryption limit the payload size?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#Where_LaraPush_fits\" title=\"Where LaraPush fits\">Where LaraPush fits<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#Frequently_asked_questions\" title=\"Frequently asked questions\">Frequently asked questions<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_does_web_push_encryption_work\"><\/span>How does web push encryption work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Web push encryption works like a sealed envelope that only one browser can open. The browser publishes a public key when it subscribes. Your server uses that key to lock each message, so the push service in the middle can carry it but not read it.<\/p>\n\n\n\n<p>The process follows the same steps for every message:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The browser subscribes through the Push API and creates a key pair plus a random auth secret.<\/li>\n\n\n\n<li>Your site sends the subscription (endpoint, p256dh and auth) to your server.<\/li>\n\n\n\n<li>For each message, your server creates a new temporary (ephemeral) P-256 key pair and a random 16-byte salt.<\/li>\n\n\n\n<li>The server runs ECDH between its temporary private key and the browser&#8217;s p256dh public key to get a shared secret.<\/li>\n\n\n\n<li>HKDF mixes that shared secret with the auth secret and salt to derive a content encryption key and a nonce.<\/li>\n\n\n\n<li>The payload is encrypted with AES-128-GCM and sent with the server&#8217;s temporary public key in the message header.<\/li>\n\n\n\n<li>The browser repeats the key agreement with its private key, derives the same key, and decrypts the payload for your service worker.<\/li>\n<\/ol>\n\n\n\n<p>Because the server makes a fresh key pair and salt for every message, two identical notifications never produce the same ciphertext.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_are_the_p256dh_and_auth_keys_in_a_push_subscription\"><\/span>What are the p256dh and auth keys in a push subscription?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The p256dh and auth values are the two keys the browser hands you so you can encrypt messages for it. You&#8217;ll see them in every PushSubscription object, next to the endpoint URL:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Field<\/th><th>What it is<\/th><th>Size<\/th><th>Who can see it<\/th><\/tr><\/thead><tbody><tr><td>endpoint<\/td><td>URL at the push service for this subscription<\/td><td>Varies by browser<\/td><td>Your server and the push service<\/td><\/tr><tr><td>keys.p256dh<\/td><td>Browser&#8217;s P-256 ECDH public key<\/td><td>65 bytes (Base64URL encoded)<\/td><td>Your server<\/td><\/tr><tr><td>keys.auth<\/td><td>Random authentication secret<\/td><td>16 bytes (Base64URL encoded)<\/td><td>Your server<\/td><\/tr><tr><td>Private key<\/td><td>Matching private key<\/td><td>Never leaves the browser<\/td><td>Only the browser<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Treat p256dh and auth as sensitive. Anyone who holds them and the endpoint could encrypt a message for that subscriber, although they would still need your VAPID private key to get the push service to accept it. I store them in the same database table as the endpoint and never expose them in front-end code or logs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_the_push_service_read_your_notifications\"><\/span>Can the push service read your notifications?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>No. Firebase Cloud Messaging (FCM), Mozilla&#8217;s autopush and Apple&#8217;s web push service only receive encrypted bytes, so they can&#8217;t read the title, body or link inside your payload. That&#8217;s the whole point of RFC 8291.<\/p>\n\n\n\n<p>That said, encryption doesn&#8217;t hide everything. The push service still knows the endpoint, the time of each request, the payload size and headers such as TTL and Urgency. My post on <a href=\"https:\/\/larapush.com\/blog\/what-data-web-push-service-stores\/\">what data a web push service stores<\/a> covers that side in more detail.<\/p>\n\n\n\n<p>On the browser side, the decrypted payload is handed to your service worker as plain data. From there, the notification appears on screen, and anyone who can see the screen can read it. So keep one-time codes and private details out of notifications even though the transport is encrypted.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Is_VAPID_the_same_as_web_push_encryption\"><\/span>Is VAPID the same as web push encryption?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>No. VAPID and encryption solve two different problems, and people mix them up all the time. Encryption protects the content for the subscriber. VAPID proves to the push service that the message comes from the server the subscriber signed up with.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>Web push encryption<\/th><th>VAPID<\/th><\/tr><\/thead><tbody><tr><td>Standard<\/td><td>RFC 8291 and RFC 8188<\/td><td>RFC 8292<\/td><\/tr><tr><td>Keys used<\/td><td>Browser&#8217;s p256dh and auth, plus a fresh server key per message<\/td><td>Your site&#8217;s fixed VAPID key pair<\/td><\/tr><tr><td>Protects<\/td><td>Message content from the push service<\/td><td>Subscriptions from being used by other senders<\/td><\/tr><tr><td>What a failure looks like<\/td><td>Browser can&#8217;t decrypt; nothing shows<\/td><td>Push service rejects with 401 or 403<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>If you want the full VAPID story, read my explainer on <a href=\"https:\/\/larapush.com\/blog\/vapid-keys-web-push\/\">VAPID keys for web push<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_the_difference_between_aes128gcm_and_aesgcm\"><\/span>What is the difference between aes128gcm and aesgcm?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>aes128gcm is the current, standard content coding, and you should use it. aesgcm is an older draft format that some early Chrome and Edge versions used before RFC 8291 was finalised.<\/p>\n\n\n\n<p>In aes128gcm, the salt, record size and server public key travel inside the encrypted body&#8217;s header. The old aesgcm format put them in separate Encryption and Crypto-Key HTTP headers instead. You can check what a browser accepts with PushManager.supportedContentEncodings, which <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/PushManager\/supportedContentEncodings_static\" target=\"_blank\" rel=\"noreferrer noopener\">MDN documents here<\/a>. Modern libraries default to aes128gcm, so in practice you rarely touch this setting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Do_you_have_to_write_the_encryption_code_yourself\"><\/span>Do you have to write the encryption code yourself?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>No, and I wouldn&#8217;t recommend it. Maintained libraries already implement RFC 8291 correctly, and hand-rolled crypto is an easy place to make subtle mistakes. You pass the subscription and the payload; the library does the key agreement, key derivation and encryption.<\/p>\n\n\n\n<p>The common choices are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Node.js:<\/strong> the web-push package, shown in my guide to <a href=\"https:\/\/larapush.com\/blog\/send-web-push-notifications-nodejs\/\">sending web push with Node.js<\/a>.<\/li>\n\n\n\n<li><strong>PHP and Laravel:<\/strong> web-push-php (minishlink\/web-push), covered in <a href=\"https:\/\/larapush.com\/blog\/send-web-push-php-laravel\/\">sending web push with PHP and Laravel<\/a>.<\/li>\n\n\n\n<li><strong>Python:<\/strong> pywebpush, covered in <a href=\"https:\/\/larapush.com\/blog\/send-web-push-notifications-python\/\">sending web push with Python<\/a>.<\/li>\n<\/ul>\n\n\n\n<p>If you use the Firebase JavaScript SDK for subscribing, FCM handles the web push encryption on its side when it forwards your message to the browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Does_encryption_limit_the_payload_size\"><\/span>Does encryption limit the payload size?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Yes, a little. Push services only need to accept 4,096 bytes of encrypted body. After the 86-byte header, at least 1 byte of padding and a 16-byte authentication tag, RFC 8291 says that leaves at most 3,993 bytes of plaintext.<\/p>\n\n\n\n<p>In practice, that&#8217;s plenty for a title, body, icon URL, image URL and click link. Send URLs, not images, and keep extra data small. My post on the <a href=\"https:\/\/larapush.com\/blog\/web-push-payload-size-limit\/\">web push payload size limit<\/a> shows what to do when you hit a 413 error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_LaraPush_fits\"><\/span>Where LaraPush fits<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you&#8217;d rather not deal with keys and encryption at all, a self-hosted panel handles it for you. LaraPush is a self-hosted web push panel that you install on your own VPS, with a one-time licence from $499 (check <a href=\"https:\/\/larapush.com\/pricing\/\">LaraPush pricing<\/a>). It sends through Firebase Cloud Messaging and stores subscriber data in your own MySQL database, so the subscription keys stay on a server you control. The <a href=\"https:\/\/larapush.com\/features\/\">features page<\/a> lists what&#8217;s included. The trade-offs are no free plan and a server you maintain. For other options, see my roundup of the <a href=\"https:\/\/larapush.com\/blog\/best-push-notification-services-and-tools\/\">best push notification services and tools<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1764233000000\"><strong class=\"schema-faq-question\">Are web push notifications end-to-end encrypted?<\/strong> <p class=\"schema-faq-answer\">The payload is. RFC 8291 encrypts each message between your server and the subscribed browser, so the push service can&#8217;t read it. However, the push service still sees metadata such as the endpoint, timing and size. Once the browser decrypts the message, the notification appears in plain text on the screen.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764233001111\"><strong class=\"schema-faq-question\">What happens if the p256dh or auth key is wrong?<\/strong> <p class=\"schema-faq-answer\">The push service usually still accepts the message, because it can&#8217;t check the encryption. The browser then fails to decrypt it, so the push event never gets usable data and nothing useful appears. If one subscriber gets nothing while others work, check that you stored their keys exactly as the browser sent them.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764233002222\"><strong class=\"schema-faq-question\">Do I need my own SSL certificate for web push encryption?<\/strong> <p class=\"schema-faq-answer\">You need HTTPS on your site, because the Push API only works in secure contexts. That certificate is separate from web push encryption, which uses per-message keys under RFC 8291. Your server&#8217;s connection to the push service also uses HTTPS, but your libraries handle that automatically.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764233003333\"><strong class=\"schema-faq-question\">Can I send a web push notification without a payload?<\/strong> <p class=\"schema-faq-answer\">Yes. A push message with no body needs no encryption keys. The service worker then shows a generic notification or fetches the content from your server. Most sites send an encrypted payload instead, because it saves an extra network request and shows the right content even on a slow connection.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764233004444\"><strong class=\"schema-faq-question\">Does web push encryption make it safe to send passwords or OTPs?<\/strong> <p class=\"schema-faq-answer\">No. Encryption protects the message in transit, but the decrypted text appears on screen and often on the lock screen. Anyone near the device can read it. Keep passwords, full one-time codes and personal data out of notifications, and link to a signed-in page instead.<\/p> <\/div><\/div>\n","protected":false},"excerpt":{"rendered":"How web push encryption works under RFC 8291: p256dh and auth keys, ECDH and AES-128-GCM, what push services can see, and how VAPID differs.","protected":false},"author":7,"featured_media":3591,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":""},"categories":[63],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How Are Web Push Notifications Encrypted?<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How Are Web Push Notifications Encrypted?\" \/>\n<meta property=\"og:description\" content=\"How web push encryption works under RFC 8291: p256dh and auth keys, ECDH and AES-128-GCM, what push services can see, and how VAPID differs.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\" \/>\n<meta property=\"og:site_name\" content=\"LaraPush Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-27T04:37:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ritesh Das\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ritesh Das\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\"},\"author\":{\"name\":\"Ritesh Das\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd\"},\"headline\":\"How Are Web Push Notifications Encrypted?\",\"datePublished\":\"2026-11-27T04:37:59+00:00\",\"dateModified\":\"2026-11-27T04:37:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\"},\"wordCount\":1561,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg\",\"articleSection\":[\"Guides\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\",\"url\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\",\"name\":\"How Are Web Push Notifications Encrypted?\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg\",\"datePublished\":\"2026-11-27T04:37:59+00:00\",\"dateModified\":\"2026-11-27T04:37:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233000000\"},{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233001111\"},{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233002222\"},{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233003333\"},{\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233004444\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg\",\"width\":1200,\"height\":675,\"caption\":\"Illustration of web push encryption, a notification envelope sealed with a padlock on a laptop screen\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/larapush.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How Are Web Push Notifications Encrypted?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/larapush.com\/blog\/#website\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"name\":\"LaraPush Blog\",\"description\":\"Stay Ahead, Stay Notified with LaraPush!\",\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/larapush.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/larapush.com\/blog\/#organization\",\"name\":\"LaraPush\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"width\":280,\"height\":60,\"caption\":\"LaraPush\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd\",\"name\":\"Ritesh Das\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g\",\"caption\":\"Ritesh Das\"},\"url\":\"https:\/\/larapush.com\/blog\/author\/riteshdas\/\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233000000\",\"position\":1,\"url\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233000000\",\"name\":\"Are web push notifications end-to-end encrypted?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The payload is. RFC 8291 encrypts each message between your server and the subscribed browser, so the push service can't read it. However, the push service still sees metadata such as the endpoint, timing and size. Once the browser decrypts the message, the notification appears in plain text on the screen.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233001111\",\"position\":2,\"url\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233001111\",\"name\":\"What happens if the p256dh or auth key is wrong?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The push service usually still accepts the message, because it can't check the encryption. The browser then fails to decrypt it, so the push event never gets usable data and nothing useful appears. If one subscriber gets nothing while others work, check that you stored their keys exactly as the browser sent them.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233002222\",\"position\":3,\"url\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233002222\",\"name\":\"Do I need my own SSL certificate for web push encryption?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"You need HTTPS on your site, because the Push API only works in secure contexts. That certificate is separate from web push encryption, which uses per-message keys under RFC 8291. Your server's connection to the push service also uses HTTPS, but your libraries handle that automatically.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233003333\",\"position\":4,\"url\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233003333\",\"name\":\"Can I send a web push notification without a payload?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. A push message with no body needs no encryption keys. The service worker then shows a generic notification or fetches the content from your server. Most sites send an encrypted payload instead, because it saves an extra network request and shows the right content even on a slow connection.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233004444\",\"position\":5,\"url\":\"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233004444\",\"name\":\"Does web push encryption make it safe to send passwords or OTPs?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No. Encryption protects the message in transit, but the decrypted text appears on screen and often on the lock screen. Anyone near the device can read it. Keep passwords, full one-time codes and personal data out of notifications, and link to a signed-in page instead.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How Are Web Push Notifications Encrypted?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/","og_locale":"en_US","og_type":"article","og_title":"How Are Web Push Notifications Encrypted?","og_description":"How web push encryption works under RFC 8291: p256dh and auth keys, ECDH and AES-128-GCM, what push services can see, and how VAPID differs.","og_url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/","og_site_name":"LaraPush Blog","article_published_time":"2026-11-27T04:37:59+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg","type":"image\/jpeg"}],"author":"Ritesh Das","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ritesh Das","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#article","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/"},"author":{"name":"Ritesh Das","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd"},"headline":"How Are Web Push Notifications Encrypted?","datePublished":"2026-11-27T04:37:59+00:00","dateModified":"2026-11-27T04:37:59+00:00","mainEntityOfPage":{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/"},"wordCount":1561,"commentCount":0,"publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"image":{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg","articleSection":["Guides"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/","url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/","name":"How Are Web Push Notifications Encrypted?","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage"},"image":{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg","datePublished":"2026-11-27T04:37:59+00:00","dateModified":"2026-11-27T04:37:59+00:00","breadcrumb":{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233000000"},{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233001111"},{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233002222"},{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233003333"},{"@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233004444"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/larapush.com\/blog\/web-push-encryption-explained\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#primaryimage","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/web-push-encryption-explained.jpg","width":1200,"height":675,"caption":"Illustration of web push encryption, a notification envelope sealed with a padlock on a laptop screen"},{"@type":"BreadcrumbList","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/larapush.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How Are Web Push Notifications Encrypted?"}]},{"@type":"WebSite","@id":"https:\/\/larapush.com\/blog\/#website","url":"https:\/\/larapush.com\/blog\/","name":"LaraPush Blog","description":"Stay Ahead, Stay Notified with LaraPush!","publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/larapush.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/larapush.com\/blog\/#organization","name":"LaraPush","url":"https:\/\/larapush.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","width":280,"height":60,"caption":"LaraPush"},"image":{"@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd","name":"Ritesh Das","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g","caption":"Ritesh Das"},"url":"https:\/\/larapush.com\/blog\/author\/riteshdas\/"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233000000","position":1,"url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233000000","name":"Are web push notifications end-to-end encrypted?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The payload is. RFC 8291 encrypts each message between your server and the subscribed browser, so the push service can't read it. However, the push service still sees metadata such as the endpoint, timing and size. Once the browser decrypts the message, the notification appears in plain text on the screen.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233001111","position":2,"url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233001111","name":"What happens if the p256dh or auth key is wrong?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The push service usually still accepts the message, because it can't check the encryption. The browser then fails to decrypt it, so the push event never gets usable data and nothing useful appears. If one subscriber gets nothing while others work, check that you stored their keys exactly as the browser sent them.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233002222","position":3,"url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233002222","name":"Do I need my own SSL certificate for web push encryption?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"You need HTTPS on your site, because the Push API only works in secure contexts. That certificate is separate from web push encryption, which uses per-message keys under RFC 8291. Your server's connection to the push service also uses HTTPS, but your libraries handle that automatically.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233003333","position":4,"url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233003333","name":"Can I send a web push notification without a payload?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes. A push message with no body needs no encryption keys. The service worker then shows a generic notification or fetches the content from your server. Most sites send an encrypted payload instead, because it saves an extra network request and shows the right content even on a slow connection.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233004444","position":5,"url":"https:\/\/larapush.com\/blog\/web-push-encryption-explained\/#faq-question-1764233004444","name":"Does web push encryption make it safe to send passwords or OTPs?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"No. Encryption protects the message in transit, but the decrypted text appears on screen and often on the lock screen. Anyone near the device can read it. Keep passwords, full one-time codes and personal data out of notifications, and link to a signed-in page instead.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3586"}],"collection":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/comments?post=3586"}],"version-history":[{"count":1,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3586\/revisions"}],"predecessor-version":[{"id":3592,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3586\/revisions\/3592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media\/3591"}],"wp:attachment":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media?parent=3586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/categories?post=3586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/tags?post=3586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}