Can keypair be changed for every message on end-to-end encryption?












4















I am thinking of security in an encrypted app, and was wondering if it would be feasible and if it would in any way add any security to the app if the keypair created for a user could change with each message sent, so every message is encrypted with a different private key? I understand there would a tremendous need for syncing between user's keys, but this is just a hypothesis I am thinking of.
thanks










share|improve this question



























    4















    I am thinking of security in an encrypted app, and was wondering if it would be feasible and if it would in any way add any security to the app if the keypair created for a user could change with each message sent, so every message is encrypted with a different private key? I understand there would a tremendous need for syncing between user's keys, but this is just a hypothesis I am thinking of.
    thanks










    share|improve this question

























      4












      4








      4








      I am thinking of security in an encrypted app, and was wondering if it would be feasible and if it would in any way add any security to the app if the keypair created for a user could change with each message sent, so every message is encrypted with a different private key? I understand there would a tremendous need for syncing between user's keys, but this is just a hypothesis I am thinking of.
      thanks










      share|improve this question














      I am thinking of security in an encrypted app, and was wondering if it would be feasible and if it would in any way add any security to the app if the keypair created for a user could change with each message sent, so every message is encrypted with a different private key? I understand there would a tremendous need for syncing between user's keys, but this is just a hypothesis I am thinking of.
      thanks







      encryption public-key-encryption private-key






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 25 '18 at 5:54









      qafamqafam

      212




      212
























          3 Answers
          3






          active

          oldest

          votes


















          2














          Of course, you can use only one key for each message and we called this forward security. To achieve this you need to use a key exchange protocol as Diffie-Hellman Key exchange protocol. This will increase communication, but security is not cheap and it is used in TLS 1.3



          With forward secrecy, even successful attacks in of the parties, the attacker can at most access the current key if there is an encryption operation. The previous keys are not stored once the message was sent so there is no key compromise.






          share|improve this answer































            2














            It is well possible, but feasibility may depend on how you use your keys.



            As already answered - ephemeral (one-time temporary) keys are used in TLS for achieving forward-secrecy in the key-excange to derive symmetric session encryption keys. So it's not really a new keypair for every message, but rather for establishig a session. Generating a new good key may needs some performance and time.



            Even so your app needs to maintain a long-time key to sign the ephemeral public key to ensure integrity so the recceiving party can be sure the ephemeral keys are really from party it claims to be. That is as well part of te TLS key exchange.



            If you are not using direct (session) communication, but sending the messages asynchronously, I see no point to generate a new keypair. You can just create a new random encryption key (assuming hybrid encryption). To ensure integrity the message needs to be signed by the sender as well, so a long-lived persistent key is necessary.






            share|improve this answer































              0














              For encryption, the message receiver could generate a new public/private key pair and send the public key to the message sender. The sender could then encrypt using this public key. This decreases the risk due to a compromised key pair. You lose just one message if the ephemeral key is compromised instead of all of them if a long-term key is compromised.



              However, encrypting alone does not provide security. You also need to authenticate the sender and receiver and provide integrity.



              For authentication, you either need a large set of pre-generated keys that are mapped to particular identities in a secure way (e.g., certificate signed by trusted certificate authority, as in PKI), or some other way to prove who generated each key pair. This is the tremendous syncing effort you mention.



              The PKI method introduces many ways to authenticate as a user due to their many keys, so it actually reduces security by increasing the attack surface. If you do things right, the bigger attack surface is balanced by the fact that an attack on an ephemeral key limits damage to a single message. However, to enforce this limit, you have to have a secure, public place where a list of valid/used keys is maintained in real-time. Otherwise the single-use keys could be re-used.



              If you don't pre-generate keys, you need a long-term public/private key pair to establish ownership of the temporary pair through a method such as a signature. You may reduce the risk of compromise to the long-term key pair by using it just for signing ephemeral key pairs. However, this just reduces one type of risk associated with the long-term key pair. You still have risks associated with generation, distribution, storage, and binding the long-term key pair to a particular user, and the ephemeral key pairs are dependent on the long-term key pair for their security.



              For integrity, you can use digital signatures. Many digital signature methods are similar to authentication methods, where a private key operation is the key security operation.



              Bottom line: you may be able to increase security by using ephemeral key pairs for each message, but performance will be impacted, you have to be careful about implementation, and the security benefits are minimal.






              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53465038%2fcan-keypair-be-changed-for-every-message-on-end-to-end-encryption%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                2














                Of course, you can use only one key for each message and we called this forward security. To achieve this you need to use a key exchange protocol as Diffie-Hellman Key exchange protocol. This will increase communication, but security is not cheap and it is used in TLS 1.3



                With forward secrecy, even successful attacks in of the parties, the attacker can at most access the current key if there is an encryption operation. The previous keys are not stored once the message was sent so there is no key compromise.






                share|improve this answer




























                  2














                  Of course, you can use only one key for each message and we called this forward security. To achieve this you need to use a key exchange protocol as Diffie-Hellman Key exchange protocol. This will increase communication, but security is not cheap and it is used in TLS 1.3



                  With forward secrecy, even successful attacks in of the parties, the attacker can at most access the current key if there is an encryption operation. The previous keys are not stored once the message was sent so there is no key compromise.






                  share|improve this answer


























                    2












                    2








                    2







                    Of course, you can use only one key for each message and we called this forward security. To achieve this you need to use a key exchange protocol as Diffie-Hellman Key exchange protocol. This will increase communication, but security is not cheap and it is used in TLS 1.3



                    With forward secrecy, even successful attacks in of the parties, the attacker can at most access the current key if there is an encryption operation. The previous keys are not stored once the message was sent so there is no key compromise.






                    share|improve this answer













                    Of course, you can use only one key for each message and we called this forward security. To achieve this you need to use a key exchange protocol as Diffie-Hellman Key exchange protocol. This will increase communication, but security is not cheap and it is used in TLS 1.3



                    With forward secrecy, even successful attacks in of the parties, the attacker can at most access the current key if there is an encryption operation. The previous keys are not stored once the message was sent so there is no key compromise.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 25 '18 at 7:39









                    kelalakakelalaka

                    1,54621125




                    1,54621125

























                        2














                        It is well possible, but feasibility may depend on how you use your keys.



                        As already answered - ephemeral (one-time temporary) keys are used in TLS for achieving forward-secrecy in the key-excange to derive symmetric session encryption keys. So it's not really a new keypair for every message, but rather for establishig a session. Generating a new good key may needs some performance and time.



                        Even so your app needs to maintain a long-time key to sign the ephemeral public key to ensure integrity so the recceiving party can be sure the ephemeral keys are really from party it claims to be. That is as well part of te TLS key exchange.



                        If you are not using direct (session) communication, but sending the messages asynchronously, I see no point to generate a new keypair. You can just create a new random encryption key (assuming hybrid encryption). To ensure integrity the message needs to be signed by the sender as well, so a long-lived persistent key is necessary.






                        share|improve this answer




























                          2














                          It is well possible, but feasibility may depend on how you use your keys.



                          As already answered - ephemeral (one-time temporary) keys are used in TLS for achieving forward-secrecy in the key-excange to derive symmetric session encryption keys. So it's not really a new keypair for every message, but rather for establishig a session. Generating a new good key may needs some performance and time.



                          Even so your app needs to maintain a long-time key to sign the ephemeral public key to ensure integrity so the recceiving party can be sure the ephemeral keys are really from party it claims to be. That is as well part of te TLS key exchange.



                          If you are not using direct (session) communication, but sending the messages asynchronously, I see no point to generate a new keypair. You can just create a new random encryption key (assuming hybrid encryption). To ensure integrity the message needs to be signed by the sender as well, so a long-lived persistent key is necessary.






                          share|improve this answer


























                            2












                            2








                            2







                            It is well possible, but feasibility may depend on how you use your keys.



                            As already answered - ephemeral (one-time temporary) keys are used in TLS for achieving forward-secrecy in the key-excange to derive symmetric session encryption keys. So it's not really a new keypair for every message, but rather for establishig a session. Generating a new good key may needs some performance and time.



                            Even so your app needs to maintain a long-time key to sign the ephemeral public key to ensure integrity so the recceiving party can be sure the ephemeral keys are really from party it claims to be. That is as well part of te TLS key exchange.



                            If you are not using direct (session) communication, but sending the messages asynchronously, I see no point to generate a new keypair. You can just create a new random encryption key (assuming hybrid encryption). To ensure integrity the message needs to be signed by the sender as well, so a long-lived persistent key is necessary.






                            share|improve this answer













                            It is well possible, but feasibility may depend on how you use your keys.



                            As already answered - ephemeral (one-time temporary) keys are used in TLS for achieving forward-secrecy in the key-excange to derive symmetric session encryption keys. So it's not really a new keypair for every message, but rather for establishig a session. Generating a new good key may needs some performance and time.



                            Even so your app needs to maintain a long-time key to sign the ephemeral public key to ensure integrity so the recceiving party can be sure the ephemeral keys are really from party it claims to be. That is as well part of te TLS key exchange.



                            If you are not using direct (session) communication, but sending the messages asynchronously, I see no point to generate a new keypair. You can just create a new random encryption key (assuming hybrid encryption). To ensure integrity the message needs to be signed by the sender as well, so a long-lived persistent key is necessary.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 25 '18 at 8:26









                            gusto2gusto2

                            4,9482921




                            4,9482921























                                0














                                For encryption, the message receiver could generate a new public/private key pair and send the public key to the message sender. The sender could then encrypt using this public key. This decreases the risk due to a compromised key pair. You lose just one message if the ephemeral key is compromised instead of all of them if a long-term key is compromised.



                                However, encrypting alone does not provide security. You also need to authenticate the sender and receiver and provide integrity.



                                For authentication, you either need a large set of pre-generated keys that are mapped to particular identities in a secure way (e.g., certificate signed by trusted certificate authority, as in PKI), or some other way to prove who generated each key pair. This is the tremendous syncing effort you mention.



                                The PKI method introduces many ways to authenticate as a user due to their many keys, so it actually reduces security by increasing the attack surface. If you do things right, the bigger attack surface is balanced by the fact that an attack on an ephemeral key limits damage to a single message. However, to enforce this limit, you have to have a secure, public place where a list of valid/used keys is maintained in real-time. Otherwise the single-use keys could be re-used.



                                If you don't pre-generate keys, you need a long-term public/private key pair to establish ownership of the temporary pair through a method such as a signature. You may reduce the risk of compromise to the long-term key pair by using it just for signing ephemeral key pairs. However, this just reduces one type of risk associated with the long-term key pair. You still have risks associated with generation, distribution, storage, and binding the long-term key pair to a particular user, and the ephemeral key pairs are dependent on the long-term key pair for their security.



                                For integrity, you can use digital signatures. Many digital signature methods are similar to authentication methods, where a private key operation is the key security operation.



                                Bottom line: you may be able to increase security by using ephemeral key pairs for each message, but performance will be impacted, you have to be careful about implementation, and the security benefits are minimal.






                                share|improve this answer




























                                  0














                                  For encryption, the message receiver could generate a new public/private key pair and send the public key to the message sender. The sender could then encrypt using this public key. This decreases the risk due to a compromised key pair. You lose just one message if the ephemeral key is compromised instead of all of them if a long-term key is compromised.



                                  However, encrypting alone does not provide security. You also need to authenticate the sender and receiver and provide integrity.



                                  For authentication, you either need a large set of pre-generated keys that are mapped to particular identities in a secure way (e.g., certificate signed by trusted certificate authority, as in PKI), or some other way to prove who generated each key pair. This is the tremendous syncing effort you mention.



                                  The PKI method introduces many ways to authenticate as a user due to their many keys, so it actually reduces security by increasing the attack surface. If you do things right, the bigger attack surface is balanced by the fact that an attack on an ephemeral key limits damage to a single message. However, to enforce this limit, you have to have a secure, public place where a list of valid/used keys is maintained in real-time. Otherwise the single-use keys could be re-used.



                                  If you don't pre-generate keys, you need a long-term public/private key pair to establish ownership of the temporary pair through a method such as a signature. You may reduce the risk of compromise to the long-term key pair by using it just for signing ephemeral key pairs. However, this just reduces one type of risk associated with the long-term key pair. You still have risks associated with generation, distribution, storage, and binding the long-term key pair to a particular user, and the ephemeral key pairs are dependent on the long-term key pair for their security.



                                  For integrity, you can use digital signatures. Many digital signature methods are similar to authentication methods, where a private key operation is the key security operation.



                                  Bottom line: you may be able to increase security by using ephemeral key pairs for each message, but performance will be impacted, you have to be careful about implementation, and the security benefits are minimal.






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    For encryption, the message receiver could generate a new public/private key pair and send the public key to the message sender. The sender could then encrypt using this public key. This decreases the risk due to a compromised key pair. You lose just one message if the ephemeral key is compromised instead of all of them if a long-term key is compromised.



                                    However, encrypting alone does not provide security. You also need to authenticate the sender and receiver and provide integrity.



                                    For authentication, you either need a large set of pre-generated keys that are mapped to particular identities in a secure way (e.g., certificate signed by trusted certificate authority, as in PKI), or some other way to prove who generated each key pair. This is the tremendous syncing effort you mention.



                                    The PKI method introduces many ways to authenticate as a user due to their many keys, so it actually reduces security by increasing the attack surface. If you do things right, the bigger attack surface is balanced by the fact that an attack on an ephemeral key limits damage to a single message. However, to enforce this limit, you have to have a secure, public place where a list of valid/used keys is maintained in real-time. Otherwise the single-use keys could be re-used.



                                    If you don't pre-generate keys, you need a long-term public/private key pair to establish ownership of the temporary pair through a method such as a signature. You may reduce the risk of compromise to the long-term key pair by using it just for signing ephemeral key pairs. However, this just reduces one type of risk associated with the long-term key pair. You still have risks associated with generation, distribution, storage, and binding the long-term key pair to a particular user, and the ephemeral key pairs are dependent on the long-term key pair for their security.



                                    For integrity, you can use digital signatures. Many digital signature methods are similar to authentication methods, where a private key operation is the key security operation.



                                    Bottom line: you may be able to increase security by using ephemeral key pairs for each message, but performance will be impacted, you have to be careful about implementation, and the security benefits are minimal.






                                    share|improve this answer













                                    For encryption, the message receiver could generate a new public/private key pair and send the public key to the message sender. The sender could then encrypt using this public key. This decreases the risk due to a compromised key pair. You lose just one message if the ephemeral key is compromised instead of all of them if a long-term key is compromised.



                                    However, encrypting alone does not provide security. You also need to authenticate the sender and receiver and provide integrity.



                                    For authentication, you either need a large set of pre-generated keys that are mapped to particular identities in a secure way (e.g., certificate signed by trusted certificate authority, as in PKI), or some other way to prove who generated each key pair. This is the tremendous syncing effort you mention.



                                    The PKI method introduces many ways to authenticate as a user due to their many keys, so it actually reduces security by increasing the attack surface. If you do things right, the bigger attack surface is balanced by the fact that an attack on an ephemeral key limits damage to a single message. However, to enforce this limit, you have to have a secure, public place where a list of valid/used keys is maintained in real-time. Otherwise the single-use keys could be re-used.



                                    If you don't pre-generate keys, you need a long-term public/private key pair to establish ownership of the temporary pair through a method such as a signature. You may reduce the risk of compromise to the long-term key pair by using it just for signing ephemeral key pairs. However, this just reduces one type of risk associated with the long-term key pair. You still have risks associated with generation, distribution, storage, and binding the long-term key pair to a particular user, and the ephemeral key pairs are dependent on the long-term key pair for their security.



                                    For integrity, you can use digital signatures. Many digital signature methods are similar to authentication methods, where a private key operation is the key security operation.



                                    Bottom line: you may be able to increase security by using ephemeral key pairs for each message, but performance will be impacted, you have to be careful about implementation, and the security benefits are minimal.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Dec 20 '18 at 19:56









                                    juhraffejuhraffe

                                    355213




                                    355213






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53465038%2fcan-keypair-be-changed-for-every-message-on-end-to-end-encryption%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        To store a contact into the json file from server.js file using a class in NodeJS

                                        Redirect URL with Chrome Remote Debugging Android Devices

                                        Dieringhausen