Encrypt and envelope in VB.NET












0















I need to encrypt and envelope a zip file to be sent to an FTP area.
The guide they have provided us requires:




The data transmitted via SFTP will be encrypted and digitally signed in order to ensure its origin and confidentiality. The data will first be signed, with the PKCS7 format and then encrypted. The formats used to envelope the signed and encrypted data will comply with the PKCS # 7 standard; in particular, "signed data" formats will be used for signed data and "enveloped data" for encrypted data.



More specifically, the standard for data signature and encryption is the mixed S / MIME standard, with signature envelope and encryption complying with the PKCS # 7 v1.5 standard, with DER format encoding.



In the encryption phase the data are encrypted using a symmetric key algorithm, generated randomly from time to time. The key used is then inserted into the envelope, encrypted with the public RSA key of the recipient.



The asymmetric encryption algorithm, based on the private key - public key pair is RSA; the length of the keys is from 512 to 4096.



The symmetric encryption algorithms supported are: RC2, DES, DES-EDE-3, AES-128, AES-192, AES-256.



The supported HASH algorithms are: MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512.




Below is what we have available:




  • (CF Responsabile) _firma.p12, which contains the key and certificate of signature of the Entity

  • (CF Responsabile) _cifra.p12, which contains the key and certificate of the institution's figure

  • sogeiunicocifra.pem, which contains the digit certificate

  • CA.pem, which contains the certificate of the Certification Authority


I can't use OpenSSL and already have read tons of guides and examples but I don't undertand ho to use private/public keys to encrypt/envelope the zip file with p12 and PEM files.



Thank you in advice for every help.










share|improve this question





























    0















    I need to encrypt and envelope a zip file to be sent to an FTP area.
    The guide they have provided us requires:




    The data transmitted via SFTP will be encrypted and digitally signed in order to ensure its origin and confidentiality. The data will first be signed, with the PKCS7 format and then encrypted. The formats used to envelope the signed and encrypted data will comply with the PKCS # 7 standard; in particular, "signed data" formats will be used for signed data and "enveloped data" for encrypted data.



    More specifically, the standard for data signature and encryption is the mixed S / MIME standard, with signature envelope and encryption complying with the PKCS # 7 v1.5 standard, with DER format encoding.



    In the encryption phase the data are encrypted using a symmetric key algorithm, generated randomly from time to time. The key used is then inserted into the envelope, encrypted with the public RSA key of the recipient.



    The asymmetric encryption algorithm, based on the private key - public key pair is RSA; the length of the keys is from 512 to 4096.



    The symmetric encryption algorithms supported are: RC2, DES, DES-EDE-3, AES-128, AES-192, AES-256.



    The supported HASH algorithms are: MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512.




    Below is what we have available:




    • (CF Responsabile) _firma.p12, which contains the key and certificate of signature of the Entity

    • (CF Responsabile) _cifra.p12, which contains the key and certificate of the institution's figure

    • sogeiunicocifra.pem, which contains the digit certificate

    • CA.pem, which contains the certificate of the Certification Authority


    I can't use OpenSSL and already have read tons of guides and examples but I don't undertand ho to use private/public keys to encrypt/envelope the zip file with p12 and PEM files.



    Thank you in advice for every help.










    share|improve this question



























      0












      0








      0








      I need to encrypt and envelope a zip file to be sent to an FTP area.
      The guide they have provided us requires:




      The data transmitted via SFTP will be encrypted and digitally signed in order to ensure its origin and confidentiality. The data will first be signed, with the PKCS7 format and then encrypted. The formats used to envelope the signed and encrypted data will comply with the PKCS # 7 standard; in particular, "signed data" formats will be used for signed data and "enveloped data" for encrypted data.



      More specifically, the standard for data signature and encryption is the mixed S / MIME standard, with signature envelope and encryption complying with the PKCS # 7 v1.5 standard, with DER format encoding.



      In the encryption phase the data are encrypted using a symmetric key algorithm, generated randomly from time to time. The key used is then inserted into the envelope, encrypted with the public RSA key of the recipient.



      The asymmetric encryption algorithm, based on the private key - public key pair is RSA; the length of the keys is from 512 to 4096.



      The symmetric encryption algorithms supported are: RC2, DES, DES-EDE-3, AES-128, AES-192, AES-256.



      The supported HASH algorithms are: MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512.




      Below is what we have available:




      • (CF Responsabile) _firma.p12, which contains the key and certificate of signature of the Entity

      • (CF Responsabile) _cifra.p12, which contains the key and certificate of the institution's figure

      • sogeiunicocifra.pem, which contains the digit certificate

      • CA.pem, which contains the certificate of the Certification Authority


      I can't use OpenSSL and already have read tons of guides and examples but I don't undertand ho to use private/public keys to encrypt/envelope the zip file with p12 and PEM files.



      Thank you in advice for every help.










      share|improve this question
















      I need to encrypt and envelope a zip file to be sent to an FTP area.
      The guide they have provided us requires:




      The data transmitted via SFTP will be encrypted and digitally signed in order to ensure its origin and confidentiality. The data will first be signed, with the PKCS7 format and then encrypted. The formats used to envelope the signed and encrypted data will comply with the PKCS # 7 standard; in particular, "signed data" formats will be used for signed data and "enveloped data" for encrypted data.



      More specifically, the standard for data signature and encryption is the mixed S / MIME standard, with signature envelope and encryption complying with the PKCS # 7 v1.5 standard, with DER format encoding.



      In the encryption phase the data are encrypted using a symmetric key algorithm, generated randomly from time to time. The key used is then inserted into the envelope, encrypted with the public RSA key of the recipient.



      The asymmetric encryption algorithm, based on the private key - public key pair is RSA; the length of the keys is from 512 to 4096.



      The symmetric encryption algorithms supported are: RC2, DES, DES-EDE-3, AES-128, AES-192, AES-256.



      The supported HASH algorithms are: MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512.




      Below is what we have available:




      • (CF Responsabile) _firma.p12, which contains the key and certificate of signature of the Entity

      • (CF Responsabile) _cifra.p12, which contains the key and certificate of the institution's figure

      • sogeiunicocifra.pem, which contains the digit certificate

      • CA.pem, which contains the certificate of the Certification Authority


      I can't use OpenSSL and already have read tons of guides and examples but I don't undertand ho to use private/public keys to encrypt/envelope the zip file with p12 and PEM files.



      Thank you in advice for every help.







      vb.net encryption cryptography public-key






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 24 '18 at 11:07







      Jonathan Quid

















      asked Nov 23 '18 at 9:03









      Jonathan QuidJonathan Quid

      84




      84
























          0






          active

          oldest

          votes












          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%2f53443499%2fencrypt-and-envelope-in-vb-net%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f53443499%2fencrypt-and-envelope-in-vb-net%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







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini