locked
Format of encrypted file RRS feed

  • Question

  • We are going to encrypt messages with AES256 and public key certificat in a MIME/SMIME component in a pipeline connected to a file adapter.  But we need to decrypt the message via regular C# code.  We need to know the format of the encrypted file.
    We guess that AES keys are created for the encryption of the body and that the AES keys are encrypted with the public RSA key and out together in the output file.
    But how can we extract the AES key from the encrypred message? Is it the first 48 byte or?

    We also need to do it the opposit way. Create encrypted files in C# and decrypt them in Biztalk.

    Regards

    Peter

    Tuesday, January 2, 2018 11:13 AM

Answers

  • Hi Peter,

    I would use a MIME/SMIME Library to Encrypt / Decrypt the message in C# .NET.

    A few free examples (there are more, and it's pretty easy writing your own, but I don't recommend that):

    http://www.mimekit.net/

    https://github.com/jstedfast/MimeKit

    Br,

    Leo


    Did my post help? Please use "Vote As Helpful", "Mark as answer" or "Propose as answer". Thank you!


    Wednesday, January 3, 2018 8:35 AM
  • HOLD ON!

    Unless there is no other option, don't do this because there are much better and easier ways.

    Is PGP not an option?

    Even System.Security.Cryptography, with a custom Pipeline Component in BizTalk, is better.

    • Marked as answer by Peter Eriksson Wednesday, January 3, 2018 6:41 PM
    Wednesday, January 3, 2018 1:46 PM
    Moderator

All replies

  • Hi Peter,

    I would use a MIME/SMIME Library to Encrypt / Decrypt the message in C# .NET.

    A few free examples (there are more, and it's pretty easy writing your own, but I don't recommend that):

    http://www.mimekit.net/

    https://github.com/jstedfast/MimeKit

    Br,

    Leo


    Did my post help? Please use "Vote As Helpful", "Mark as answer" or "Propose as answer". Thank you!


    Wednesday, January 3, 2018 8:35 AM
  • HOLD ON!

    Unless there is no other option, don't do this because there are much better and easier ways.

    Is PGP not an option?

    Even System.Security.Cryptography, with a custom Pipeline Component in BizTalk, is better.

    • Marked as answer by Peter Eriksson Wednesday, January 3, 2018 6:41 PM
    Wednesday, January 3, 2018 1:46 PM
    Moderator