{"id":160824,"date":"2016-04-07T18:37:44","date_gmt":"2016-04-07T16:37:44","guid":{"rendered":"http:\/\/mybroadband.co.za\/news\/?p=160824"},"modified":"2016-04-07T18:38:57","modified_gmt":"2016-04-07T16:38:57","slug":"how-whatsapp-keeps-your-messages-secret","status":"publish","type":"post","link":"https:\/\/mybroadband.co.za\/news\/security\/160824-how-whatsapp-keeps-your-messages-secret.html","title":{"rendered":"How WhatsApp keeps your messages secret"},"content":{"rendered":"<p>WhatsApp has <a href=\"http:\/\/mybroadband.co.za\/news\/security\/160684-whatsapp-rolls-out-end-to-end-encryption-for-messages-calling.html\"><strong>extended the Signal Protocol<\/strong><\/a> it uses to provide end-to-end encryption to all\u00a0platforms.<\/p>\n<p>Open Whisper Systems\u00a0<strong><a href=\"https:\/\/whispersystems.org\/blog\/whatsapp-complete\/\" target=\"_blank\">said<\/a><\/strong>\u00a0it has integrated its Signal Protocol into WhatsApp\u2019s Android, iPhone, Windows Phone, Nokia S40, Nokia S60, BlackBerry, and BlackBerry 10 apps.<\/p>\n<p>Signal Protocol is an open-source, forward-secure, encryption protocol for asynchronous messaging systems.<\/p>\n<p>WhatsApp released a <strong><a href=\"https:\/\/www.whatsapp.com\/security\/WhatsApp-Security-Whitepaper.pdf\" target=\"_blank\">white paper<\/a><\/strong>\u00a0which gives a technical overview of how its encryption system works &#8211; as detailed below.<\/p>\n<hr \/>\n<h3 class=\"my-4\">How encryption works<\/h3>\n<p>Encryption systems are\u00a0typically based on a combination of public-key and symmetric-key cryptography.<\/p>\n<p>In public-key cryptography, you and the person you want to chat to generate two &#8220;keys&#8221;: a\u00a0public one that anyone can see, and a private one that you have to keep secret.<\/p>\n<p>You use\u00a0someone&#8217;s public key to encrypt a message only they can see, which they decrypt with their secret private key. This is illustrated below.<\/p>\n<div id=\"attachment_160904\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/Public-key-encryption-from-MakeUseOf.png\" rel=\"attachment wp-att-160904\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-160904\" class=\"wp-image-160904 size-new-size\" src=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/Public-key-encryption-from-MakeUseOf-640x310.png\" alt=\"Public-key encryption from MakeUseOf\" width=\"640\" height=\"310\" \/><\/a><p id=\"caption-attachment-160904\" class=\"wp-caption-text\">Public-key encryption from <a href=\"http:\/\/www.makeuseof.com\/tag\/encryption-care\/\" target=\"_blank\">MakeUseOf<\/a><\/p><\/div>\n<p>For a messaging system like WhatsApp, private keys are typically used to exchange symmetric keys &#8211; which must be securely generated.<\/p>\n<p>Messages are then encrypted with the shared symmetric keys, which all\u00a0parties in a conversation\u00a0share.<\/p>\n<div id=\"attachment_160902\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/Symmetric-key-encryption-by-MakeUseOf.png\" rel=\"attachment wp-att-160902\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-160902\" class=\"wp-image-160902 size-new-size\" src=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/Symmetric-key-encryption-by-MakeUseOf-640x310.png\" alt=\"Symmetric-key encryption by MakeUseOf\" width=\"640\" height=\"310\" \/><\/a><p id=\"caption-attachment-160902\" class=\"wp-caption-text\">Symmetric-key encryption by <a href=\"http:\/\/www.makeuseof.com\/tag\/encryption-care\/\" target=\"_blank\">MakeUseOf<\/a><\/p><\/div>\n<p>The Signal Protocol implemented in\u00a0WhatsApp is more complex than the example above, <strong><a href=\"#keys\">with more keys used to generate other keys<\/a>.<\/strong><\/p>\n<p>For example, the same symmetric key is not used to encrypt all messages in a conversation, but WhatsApp avoids the expensive operation of exchanging the new key with\u00a0a public-key encrypted message.<\/p>\n<p>Although there are differences between the example above and the Signal Protocol,\u00a0the principle remains\u00a0the same.<\/p>\n<hr \/>\n<h3 id=\"registration\">Registration<\/h3>\n<p>When you register, WhatsApp sends a public Identity Key, public Signed Pre Key with its signature, and a batch of public One-Time Pre Keys to the server.<\/p>\n<p>WhatsApp\u2019s servers never access your private keys.<\/p>\n<div id=\"attachment_160834\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-initialisation.jpg\" rel=\"attachment wp-att-160834\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-160834\" class=\"wp-image-160834 size-new-size\" src=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-initialisation-640x380.jpg\" alt=\"WhatsApp initialisation\" width=\"640\" height=\"380\" srcset=\"https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-initialisation-640x380.jpg 640w, https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-initialisation.jpg 720w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><p id=\"caption-attachment-160834\" class=\"wp-caption-text\">WhatsApp initialisation<\/p><\/div>\n<hr \/>\n<h3 id=\"settingupanencryptedchatorcall\">Setting up an encrypted chat or call<\/h3>\n<p>Your WhatsApp\u00a0clients first need to establish an encrypted session.<\/p>\n<p>Once the session is established, clients do not need to set up a new session with each other unless something causes the session state to be lost.<\/p>\n<p>This can happen if you reinstall the app, or switch to a different device.<\/p>\n<p>Until everyone on WhatsApp has updated to the latest version of the app, some chats may still be unencrypted.<\/p>\n<p>WhatsApp displays notifications in chats that are secure. You can also verify that a chat is secure via the chat&#8217;s menu.<\/p>\n<div id=\"attachment_160836\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification.jpg\" rel=\"attachment wp-att-160836\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-160836\" class=\"size-new-size wp-image-160836\" src=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-640x569.jpg\" alt=\"WhatsApp Signal Protocol encryption verification\" width=\"640\" height=\"569\" srcset=\"https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-640x569.jpg 640w, https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-484x430.jpg 484w, https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification.jpg 720w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><p id=\"caption-attachment-160836\" class=\"wp-caption-text\">WhatsApp Signal Protocol encryption verification<\/p><\/div>\n<hr \/>\n<h3 id=\"receivingsessionsetup\">Receiving Session Setup<\/h3>\n<p>After building the encryption session, the person who started the chat can start sending messages.<\/p>\n<p>Until the recipient responds, the initiator includes the information needed for the recipient to build a corresponding session in the header of all messages sent.<\/p>\n<p>Once a session has been established, clients exchange messages that are protected with a Message Key using AES256 in CBC mode for encryption and HMAC-SHA256 for authentication.<\/p>\n<p>Large attachments &#8211; video, audio, images, or files &#8211; are also encrypted.<\/p>\n<hr \/>\n<h3 id=\"groupmessages\">Group Messages<\/h3>\n<p>WhatsApp uses similar\u00a0mechanisms to encrypt group messages.<\/p>\n<p>One difference is that the sending WhatsApp client generates a Sender Key, which is encrypted and transmitted to each of the group\u2019s members individually.<\/p>\n<p>Whenever a group member leaves, all group participants clear their Sender Key and start over.<\/p>\n<hr \/>\n<h3 id=\"verifyingkeys\">Verifying Keys<\/h3>\n<p>WhatsApp gives users the option to verify the keys of other users.<\/p>\n<p>This lets you confirm that neither an unauthorised third party nor WhatsApp have initiated a man-in-the-middle attack.<\/p>\n<p>This can be done by scanning a QR code, or by comparing a 60-digit number, as depicted below.<\/p>\n<div id=\"attachment_160838\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification.png\" rel=\"attachment wp-att-160838\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-160838\" class=\"size-new-size wp-image-160838\" src=\"http:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-640x454.png\" alt=\"WhatsApp Signal Protocol key verification\" width=\"640\" height=\"454\" srcset=\"https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-640x454.png 640w, https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-120x86.png 120w, https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification-606x430.png 606w, https:\/\/mybroadband.co.za\/news\/wp-content\/uploads\/2016\/04\/WhatsApp-Signal-Protocol-encryption-verification.png 740w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><p id=\"caption-attachment-160838\" class=\"wp-caption-text\">WhatsApp Signal Protocol key verification<\/p><\/div>\n<hr \/>\n<h3 id=\"transportsecurity\">Transport Security<\/h3>\n<p>All communication between WhatsApp clients and servers is layered within a separate encrypted channel.<\/p>\n<p>On Windows Phone, iPhone, and Android, end-to-end encryption uses noise pipes with Curve25519, AES-GCM, and SHA256 from the Noise Protocol Framework for long-running interactive connections.<\/p>\n<p>WhatsApp said this provides clients with:<\/p>\n<ol>\n<li>Extremely fast, lightweight connection setup and resume.<\/li>\n<li>Metadata is encrypted, hiding it from unauthorised network observers. No information about the connecting user\u2019s identity is revealed.<\/li>\n<li>No client authentication secrets are stored on the server. If the server\u2019s user database is compromised, no private authentication credentials will be revealed.<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"keys\">Summary of key types<\/h3>\n<p><strong>Public Key Types<\/strong><\/p>\n<ul>\n<li>Identity Key Pair &#8211; A long-term Curve25519 key pair, generated at install time.<\/li>\n<li>Signed Pre Key &#8211; A medium-term Curve25519 key pair, generated at install time, signed by the Identity Key, and rotated on a periodic basis.<\/li>\n<li>One-Time Pre Keys &#8211; A queue of Curve25519 key pairs for one-time use, generated at install time, and replenished as needed.<\/li>\n<\/ul>\n<p><strong>Session Key Types<\/strong><\/p>\n<ul>\n<li>Root Key &#8211; A 32-byte value that is used to create Chain Keys.<\/li>\n<li>Chain Key &#8211; A 32-byte value that is used to create Message Keys.<\/li>\n<li>Message Key &#8211; An 80-byte value that is used to encrypt message contents. 32 bytes are used for an AES-256 key, 32 bytes for a HMAC-SHA256 key, and 16 bytes for an IV.<\/li>\n<\/ul>\n<hr \/>\n<h3 id=\"related\">More on WhatsApp<\/h3>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/security\/160684-whatsapp-rolls-out-end-to-end-encryption-for-messages-calling.html\"><strong>WhatsApp rolls out end-to-end encryption for messages, calling<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/smartphones\/159263-blackberry-fought-back-against-facebook-and-whatsapp-and-lost.html\"><strong>BlackBerry fought back against Facebook and WhatsApp, and lost<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/security\/114471-whatsapp-full-end-to-end-encryption-announced.html\"><strong>WhatsApp full end-to-end encryption announced<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/internet\/158431-whatsapp-security-under-fire-eff.html\"><strong>WhatsApp security under fire: EFF<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/columns\/153289-whatsapp-regulation-in-sa-what-vodacom-and-mtn-really-want.html\"><strong>WhatsApp regulation in SA \u2013 what Vodacom and MTN really want<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is how WhatsApp\u2019s new encryption system works.<\/p>\n","protected":false},"author":23,"featured_media":153063,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sma_x_autopost_status":"idle","_sma_x_autopost_error":"","_sma_x_post_id":"","_sma_facebook_post_id":"","_sma_instagram_post_id":"","_sma_threads_post_id":"","_sma_x_attempts":0,"footnotes":""},"categories":[27,17934],"tags":[6298,36075,35,27721,36412,31470,2594],"class_list":["post-160824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-smartphones","tag-encryption","tag-end-to-end-encryption","tag-headline","tag-open-whisper-systems","tag-signal-protocol","tag-strong-encryption","tag-whatsapp"],"_links":{"self":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/160824"}],"collection":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/comments?post=160824"}],"version-history":[{"count":2,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/160824\/revisions"}],"predecessor-version":[{"id":160832,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/160824\/revisions\/160832"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media\/153063"}],"wp:attachment":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media?parent=160824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/categories?post=160824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/tags?post=160824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}